From 50788bf4727008f15d17e96dfd87af4069eb174e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 10 Aug 2022 02:41:48 +0000 Subject: [PATCH] CodeGen from PR 20157 in Azure/azure-rest-api-specs Merge fe54ce16d37ef4da02eecdc027ac33ac988d050e into 429ced7c550f9f14a43ff3bb7f6a465927abd33c --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 4631 +++++++++++++++++ .../pom.xml | 55 + .../storage/generated/StorageManager.java | 589 +++ .../fluent/BlobContainersClient.java | 694 +++ .../fluent/BlobInventoryPoliciesClient.java | 167 + .../generated/fluent/BlobServicesClient.java | 121 + .../fluent/DeletedAccountsClient.java | 64 + .../fluent/EncryptionScopesClient.java | 182 + .../generated/fluent/FileServicesClient.java | 117 + .../generated/fluent/FileSharesClient.java | 334 ++ .../fluent/LocalUsersOperationsClient.java | 230 + .../fluent/ManagementPoliciesClient.java | 126 + ...ctReplicationPoliciesOperationsClient.java | 179 + .../generated/fluent/OperationsClient.java | 36 + .../PrivateEndpointConnectionsClient.java | 167 + .../fluent/PrivateLinkResourcesClient.java | 46 + .../generated/fluent/QueueServicesClient.java | 121 + .../generated/fluent/QueuesClient.java | 208 + .../storage/generated/fluent/SkusClient.java | 36 + .../fluent/StorageAccountsClient.java | 749 +++ .../fluent/StorageManagementClient.java | 186 + .../generated/fluent/TableServicesClient.java | 121 + .../generated/fluent/TablesClient.java | 193 + .../generated/fluent/UsagesClient.java | 41 + .../fluent/models/BlobContainerInner.java | 339 ++ .../models/BlobInventoryPolicyInner.java | 89 + .../models/BlobInventoryPolicyProperties.java | 74 + .../fluent/models/BlobRestoreStatusInner.java | 89 + .../models/BlobServicePropertiesInner.java | 294 ++ .../BlobServicePropertiesProperties.java | 292 ++ .../CheckNameAvailabilityResultInner.java | 70 + .../fluent/models/ContainerProperties.java | 419 ++ .../fluent/models/DeletedAccountInner.java | 85 + .../models/DeletedAccountProperties.java | 96 + .../fluent/models/EncryptionScopeInner.java | 167 + .../models/EncryptionScopeProperties.java | 170 + .../fluent/models/FileServiceItemsInner.java | 39 + .../models/FileServicePropertiesInner.java | 136 + .../FileServicePropertiesProperties.java | 117 + .../fluent/models/FileShareInner.java | 308 ++ .../fluent/models/FileShareItemInner.java | 306 ++ .../fluent/models/FileShareProperties.java | 383 ++ .../models/ImmutabilityPolicyInner.java | 146 + .../models/ImmutabilityPolicyProperty.java | 139 + .../models/LeaseContainerResponseInner.java | 75 + .../models/LeaseShareResponseInner.java | 75 + .../fluent/models/LegalHoldInner.java | 105 + .../models/ListAccountSasResponseInner.java | 35 + .../fluent/models/ListContainerItemInner.java | 331 ++ .../fluent/models/ListQueueInner.java | 63 + .../fluent/models/ListQueueProperties.java | 49 + .../fluent/models/ListQueueServicesInner.java | 39 + .../models/ListServiceSasResponseInner.java | 35 + .../fluent/models/ListTableServicesInner.java | 39 + .../fluent/models/LocalUserInner.java | 209 + .../fluent/models/LocalUserKeysInner.java | 66 + .../fluent/models/LocalUserProperties.java | 204 + ...ocalUserRegeneratePasswordResultInner.java | 37 + .../fluent/models/ManagementPolicyInner.java | 75 + .../models/ManagementPolicyProperties.java | 77 + .../models/ObjectReplicationPolicyInner.java | 133 + .../ObjectReplicationPolicyProperties.java | 153 + .../fluent/models/OperationInner.java | 144 + .../fluent/models/OperationProperties.java | 50 + .../PrivateEndpointConnectionInner.java | 100 + .../PrivateEndpointConnectionProperties.java | 108 + .../PrivateLinkResourceListResultInner.java | 51 + .../models/PrivateLinkResourceProperties.java | 77 + .../fluent/models/QueueProperties.java | 66 + .../models/QueueServicePropertiesInner.java | 67 + .../QueueServicePropertiesProperties.java | 56 + .../fluent/models/SkuInformationInner.java | 176 + .../fluent/models/StorageAccountInner.java | 812 +++ .../StorageAccountListKeysResultInner.java | 41 + ...rageAccountPropertiesCreateParameters.java | 715 +++ .../models/StorageAccountPropertiesInner.java | 919 ++++ ...rageAccountPropertiesUpdateParameters.java | 663 +++ .../fluent/models/StorageQueueInner.java | 73 + .../generated/fluent/models/TableInner.java | 73 + .../fluent/models/TableProperties.java | 66 + .../models/TableServicePropertiesInner.java | 67 + .../TableServicePropertiesProperties.java | 56 + .../generated/fluent/models/UsageInner.java | 85 + .../generated/fluent/models/package-info.java | 6 + .../generated/fluent/package-info.java | 6 + .../implementation/BlobContainerImpl.java | 304 ++ .../BlobContainersClientImpl.java | 3575 +++++++++++++ .../implementation/BlobContainersImpl.java | 546 ++ .../BlobInventoryPoliciesClientImpl.java | 890 ++++ .../BlobInventoryPoliciesImpl.java | 217 + .../BlobInventoryPolicyImpl.java | 159 + .../implementation/BlobRestoreStatusImpl.java | 46 + .../BlobServicePropertiesImpl.java | 221 + .../BlobServicesClientImpl.java | 640 +++ .../implementation/BlobServicesImpl.java | 116 + .../CheckNameAvailabilityResultImpl.java | 42 + .../implementation/DeletedAccountImpl.java | 60 + .../DeletedAccountsClientImpl.java | 451 ++ .../implementation/DeletedAccountsImpl.java | 70 + .../implementation/EncryptionScopeImpl.java | 178 + .../EncryptionScopesClientImpl.java | 1030 ++++ .../implementation/EncryptionScopesImpl.java | 133 + .../implementation/FileServiceItemsImpl.java | 47 + .../FileServicePropertiesImpl.java | 163 + .../FileServicesClientImpl.java | 598 +++ .../implementation/FileServicesImpl.java | 129 + .../implementation/FileShareImpl.java | 295 ++ .../implementation/FileShareItemImpl.java | 137 + .../implementation/FileSharesClientImpl.java | 1888 +++++++ .../implementation/FileSharesImpl.java | 270 + .../ImmutabilityPolicyImpl.java | 197 + .../LeaseContainerResponseImpl.java | 37 + .../LeaseShareResponseImpl.java | 37 + .../implementation/LegalHoldImpl.java | 47 + .../ListAccountSasResponseImpl.java | 33 + .../implementation/ListContainerItemImpl.java | 135 + .../implementation/ListQueueImpl.java | 51 + .../implementation/ListQueueServicesImpl.java | 47 + .../ListServiceSasResponseImpl.java | 33 + .../implementation/ListTableServicesImpl.java | 47 + .../implementation/LocalUserImpl.java | 230 + .../implementation/LocalUserKeysImpl.java | 44 + ...LocalUserRegeneratePasswordResultImpl.java | 33 + .../LocalUsersOperationsClientImpl.java | 1214 +++++ .../LocalUsersOperationsImpl.java | 247 + .../ManagementPoliciesClientImpl.java | 648 +++ .../ManagementPoliciesImpl.java | 196 + .../implementation/ManagementPolicyImpl.java | 153 + ...plicationPoliciesOperationsClientImpl.java | 919 ++++ ...jectReplicationPoliciesOperationsImpl.java | 209 + .../ObjectReplicationPolicyImpl.java | 181 + .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 175 + .../implementation/OperationsImpl.java | 45 + .../PrivateEndpointConnectionImpl.java | 163 + .../PrivateEndpointConnectionsClientImpl.java | 884 ++++ .../PrivateEndpointConnectionsImpl.java | 215 + .../PrivateLinkResourceListResultImpl.java | 41 + .../PrivateLinkResourcesClientImpl.java | 226 + .../PrivateLinkResourcesImpl.java | 62 + .../QueueServicePropertiesImpl.java | 138 + .../QueueServicesClientImpl.java | 608 +++ .../implementation/QueueServicesImpl.java | 129 + .../implementation/QueuesClientImpl.java | 1209 +++++ .../generated/implementation/QueuesImpl.java | 196 + .../implementation/SkuInformationImpl.java | 78 + .../implementation/SkusClientImpl.java | 200 + .../generated/implementation/SkusImpl.java | 44 + .../implementation/StorageAccountImpl.java | 730 +++ .../StorageAccountListKeysResultImpl.java | 41 + .../StorageAccountPropertiesImpl.java | 224 + .../StorageAccountsClientImpl.java | 3756 +++++++++++++ .../implementation/StorageAccountsImpl.java | 379 ++ .../StorageManagementClientBuilder.java | 144 + .../StorageManagementClientImpl.java | 556 ++ .../implementation/StorageQueueImpl.java | 150 + .../generated/implementation/TableImpl.java | 150 + .../TableServicePropertiesImpl.java | 138 + .../TableServicesClientImpl.java | 608 +++ .../implementation/TableServicesImpl.java | 129 + .../implementation/TablesClientImpl.java | 1178 +++++ .../generated/implementation/TablesImpl.java | 192 + .../generated/implementation/UsageImpl.java | 45 + .../implementation/UsagesClientImpl.java | 222 + .../generated/implementation/UsagesImpl.java | 45 + .../generated/implementation/Utils.java | 204 + .../implementation/package-info.java | 6 + .../generated/models/AccessPolicy.java | 99 + .../storage/generated/models/AccessTier.java | 53 + .../AccountImmutabilityPolicyProperties.java | 121 + .../AccountImmutabilityPolicyState.java | 41 + .../models/AccountSasParameters.java | 267 + .../generated/models/AccountStatus.java | 50 + .../storage/generated/models/AccountType.java | 38 + .../storage/generated/models/Action.java | 47 + .../models/ActiveDirectoryProperties.java | 243 + .../generated/models/AllowedCopyScope.java | 38 + .../generated/models/AllowedMethods.java | 56 + .../generated/models/AzureEntityResource.java | 40 + ...AzureFilesIdentityBasedAuthentication.java | 120 + .../generated/models/BlobContainer.java | 549 ++ .../generated/models/BlobContainers.java | 585 +++ ...eateOrUpdateImmutabilityPolicyHeaders.java | 46 + ...ateOrUpdateImmutabilityPolicyResponse.java | 42 + ...ainersDeleteImmutabilityPolicyHeaders.java | 46 + ...inersDeleteImmutabilityPolicyResponse.java | 42 + ...ainersExtendImmutabilityPolicyHeaders.java | 46 + ...inersExtendImmutabilityPolicyResponse.java | 42 + ...ontainersGetImmutabilityPolicyHeaders.java | 46 + ...ntainersGetImmutabilityPolicyResponse.java | 42 + ...ntainersLockImmutabilityPolicyHeaders.java | 46 + ...tainersLockImmutabilityPolicyResponse.java | 42 + .../models/BlobInventoryPolicies.java | 164 + .../generated/models/BlobInventoryPolicy.java | 176 + .../models/BlobInventoryPolicyDefinition.java | 229 + .../models/BlobInventoryPolicyFilter.java | 208 + .../models/BlobInventoryPolicyName.java | 35 + .../models/BlobInventoryPolicyRule.java | 149 + .../models/BlobInventoryPolicySchema.java | 131 + .../models/BlobRestoreParameters.java | 91 + .../models/BlobRestoreProgressStatus.java | 41 + .../generated/models/BlobRestoreRange.java | 85 + .../generated/models/BlobRestoreStatus.java | 47 + .../generated/models/BlobServiceItems.java | 40 + .../models/BlobServiceProperties.java | 428 ++ .../generated/models/BlobServices.java | 109 + .../storage/generated/models/Bypass.java | 44 + .../storage/generated/models/ChangeFeed.java | 75 + .../models/CheckNameAvailabilityResult.java | 40 + .../storage/generated/models/CorsRule.java | 186 + .../storage/generated/models/CorsRules.java | 50 + .../generated/models/CustomDomain.java | 85 + .../generated/models/DateAfterCreation.java | 78 + .../models/DateAfterModification.java | 139 + .../generated/models/DefaultAction.java | 50 + .../models/DefaultSharePermission.java | 47 + .../models/DeleteRetentionPolicy.java | 107 + .../generated/models/DeletedAccount.java | 74 + .../models/DeletedAccountListResult.java | 57 + .../generated/models/DeletedAccounts.java | 57 + .../generated/models/DeletedShare.java | 86 + .../storage/generated/models/Dimension.java | 72 + .../models/DirectoryServiceOptions.java | 44 + .../generated/models/DnsEndpointType.java | 38 + .../generated/models/EnabledProtocols.java | 38 + .../storage/generated/models/Encryption.java | 164 + .../generated/models/EncryptionIdentity.java | 80 + .../generated/models/EncryptionScope.java | 280 + .../EncryptionScopeKeyVaultProperties.java | 84 + .../models/EncryptionScopeListResult.java | 57 + .../models/EncryptionScopeSource.java | 38 + .../models/EncryptionScopeState.java | 38 + .../generated/models/EncryptionScopes.java | 110 + .../generated/models/EncryptionService.java | 98 + .../generated/models/EncryptionServices.java | 136 + .../storage/generated/models/Endpoints.java | 168 + .../generated/models/ExpirationAction.java | 35 + .../generated/models/ExtendedLocation.java | 72 + .../models/ExtendedLocationTypes.java | 35 + .../generated/models/FileServiceItems.java | 25 + .../models/FileServiceProperties.java | 233 + .../generated/models/FileServices.java | 104 + .../storage/generated/models/FileShare.java | 464 ++ .../generated/models/FileShareItem.java | 180 + .../generated/models/FileShareItems.java | 60 + .../storage/generated/models/FileShares.java | 285 + .../models/FileSharesLeaseHeaders.java | 46 + .../models/FileSharesLeaseResponse.java | 41 + .../storage/generated/models/Format.java | 38 + .../generated/models/GeoReplicationStats.java | 81 + .../models/GeoReplicationStatus.java | 41 + .../generated/models/HttpProtocol.java | 50 + .../storage/generated/models/Identity.java | 128 + .../generated/models/IdentityType.java | 44 + .../generated/models/ImmutabilityPolicy.java | 306 ++ .../models/ImmutabilityPolicyProperties.java | 169 + .../models/ImmutabilityPolicyState.java | 38 + .../models/ImmutabilityPolicyUpdateType.java | 41 + .../models/ImmutableStorageAccount.java | 87 + .../ImmutableStorageWithVersioning.java | 80 + .../generated/models/InventoryRuleType.java | 35 + .../storage/generated/models/IpRule.java | 80 + .../generated/models/KeyCreationTime.java | 73 + .../generated/models/KeyPermission.java | 50 + .../storage/generated/models/KeyPolicy.java | 46 + .../storage/generated/models/KeySource.java | 38 + .../storage/generated/models/KeyType.java | 38 + .../generated/models/KeyVaultProperties.java | 147 + .../storage/generated/models/Kind.java | 47 + .../models/LargeFileSharesState.java | 38 + .../models/LastAccessTimeTrackingPolicy.java | 133 + .../models/LeaseContainerRequest.java | 166 + .../models/LeaseContainerRequestAction.java | 47 + .../models/LeaseContainerResponse.java | 32 + .../generated/models/LeaseDuration.java | 38 + .../generated/models/LeaseShareAction.java | 47 + .../generated/models/LeaseShareRequest.java | 166 + .../generated/models/LeaseShareResponse.java | 32 + .../storage/generated/models/LeaseState.java | 47 + .../storage/generated/models/LeaseStatus.java | 38 + .../storage/generated/models/LegalHold.java | 44 + .../generated/models/LegalHoldProperties.java | 99 + .../models/ListAccountSasResponse.java | 24 + .../models/ListBlobInventoryPolicy.java | 40 + .../generated/models/ListContainerItem.java | 188 + .../generated/models/ListContainerItems.java | 60 + .../models/ListContainersInclude.java | 35 + .../generated/models/ListKeyExpand.java | 47 + .../storage/generated/models/ListQueue.java | 46 + .../generated/models/ListQueueResource.java | 55 + .../generated/models/ListQueueServices.java | 25 + .../models/ListServiceSasResponse.java | 24 + .../generated/models/ListTableResource.java | 55 + .../generated/models/ListTableServices.java | 25 + .../storage/generated/models/LocalUser.java | 372 ++ .../generated/models/LocalUserKeys.java | 32 + .../LocalUserRegeneratePasswordResult.java | 26 + .../storage/generated/models/LocalUsers.java | 51 + .../models/LocalUsersOperations.java | 227 + .../generated/models/ManagementPolicies.java | 127 + .../generated/models/ManagementPolicy.java | 171 + .../models/ManagementPolicyAction.java | 107 + .../models/ManagementPolicyBaseBlob.java | 138 + .../models/ManagementPolicyDefinition.java | 86 + .../models/ManagementPolicyFilter.java | 117 + .../models/ManagementPolicyName.java | 35 + .../models/ManagementPolicyRule.java | 147 + .../models/ManagementPolicySchema.java | 63 + .../models/ManagementPolicySnapShot.java | 111 + .../models/ManagementPolicyVersion.java | 111 + .../generated/models/MetricSpecification.java | 258 + .../generated/models/MigrationState.java | 38 + .../generated/models/MinimumTlsVersion.java | 41 + .../generated/models/Multichannel.java | 46 + .../storage/generated/models/Name.java | 35 + .../generated/models/NetworkRuleSet.java | 173 + .../models/ObjectReplicationPolicies.java | 51 + .../ObjectReplicationPoliciesOperations.java | 169 + .../models/ObjectReplicationPolicy.java | 242 + .../models/ObjectReplicationPolicyFilter.java | 81 + .../models/ObjectReplicationPolicyRule.java | 145 + .../storage/generated/models/ObjectType.java | 38 + .../storage/generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 124 + .../generated/models/OperationListResult.java | 54 + .../storage/generated/models/Operations.java | 31 + .../generated/models/PermissionScope.java | 121 + .../storage/generated/models/Permissions.java | 56 + .../generated/models/PrivateEndpoint.java | 35 + .../models/PrivateEndpointConnection.java | 202 + .../PrivateEndpointConnectionListResult.java | 51 + ...teEndpointConnectionProvisioningState.java | 45 + .../models/PrivateEndpointConnections.java | 166 + ...rivateEndpointServiceConnectionStatus.java | 42 + .../generated/models/PrivateLinkResource.java | 82 + .../models/PrivateLinkResourceListResult.java | 26 + .../models/PrivateLinkResources.java | 41 + .../PrivateLinkServiceConnectionState.java | 102 + .../models/ProtectedAppendWritesHistory.java | 67 + .../generated/models/ProtocolSettings.java | 49 + .../generated/models/ProvisioningState.java | 53 + .../generated/models/PublicAccess.java | 53 + .../generated/models/PublicNetworkAccess.java | 38 + .../models/QueueServiceProperties.java | 168 + .../generated/models/QueueServices.java | 108 + .../storage/generated/models/Queues.java | 173 + .../storage/generated/models/Reason.java | 50 + .../storage/generated/models/ReasonCode.java | 38 + .../generated/models/ResourceAccessRule.java | 72 + .../models/RestorePolicyProperties.java | 105 + .../storage/generated/models/Restriction.java | 85 + .../generated/models/RootSquashType.java | 41 + .../generated/models/RoutingChoice.java | 38 + .../generated/models/RoutingPreference.java | 105 + .../storage/generated/models/RuleType.java | 35 + .../storage/generated/models/SasPolicy.java | 85 + .../storage/generated/models/Schedule.java | 38 + .../models/ServiceSasParameters.java | 507 ++ .../models/ServiceSpecification.java | 50 + .../storage/generated/models/Services.java | 44 + .../generated/models/ShareAccessTier.java | 44 + .../generated/models/SignedIdentifier.java | 75 + .../generated/models/SignedResource.java | 44 + .../generated/models/SignedResourceTypes.java | 41 + .../storage/generated/models/Sku.java | 71 + .../generated/models/SkuCapability.java | 54 + .../generated/models/SkuConversionStatus.java | 41 + .../generated/models/SkuInformation.java | 71 + .../storage/generated/models/SkuName.java | 56 + .../storage/generated/models/SkuTier.java | 50 + .../storage/generated/models/Skus.java | 31 + .../storage/generated/models/SmbSetting.java | 165 + .../generated/models/SshPublicKey.java | 74 + .../storage/generated/models/State.java | 47 + .../generated/models/StorageAccount.java | 1358 +++++ ...ccountCheckNameAvailabilityParameters.java | 86 + .../StorageAccountCreateParameters.java | 818 +++ .../models/StorageAccountExpand.java | 50 + .../StorageAccountInternetEndpoints.java | 83 + .../generated/models/StorageAccountKey.java | 81 + .../models/StorageAccountListKeysResult.java | 27 + .../models/StorageAccountListResult.java | 57 + .../StorageAccountMicrosoftEndpoints.java | 113 + .../models/StorageAccountProperties.java | 313 ++ ...StorageAccountRegenerateKeyParameters.java | 57 + .../StorageAccountSkuConversionStatus.java | 93 + .../StorageAccountUpdateParameters.java | 690 +++ .../generated/models/StorageAccounts.java | 491 ++ .../generated/models/StorageQueue.java | 167 + .../models/StorageSkuListResult.java | 40 + .../storage/generated/models/Table.java | 166 + .../generated/models/TableAccessPolicy.java | 109 + .../models/TableServiceProperties.java | 168 + .../generated/models/TableServices.java | 108 + .../models/TableSignedIdentifier.java | 83 + .../storage/generated/models/Tables.java | 164 + .../storage/generated/models/TagFilter.java | 119 + .../storage/generated/models/TagProperty.java | 96 + .../models/UpdateHistoryProperty.java | 187 + .../storage/generated/models/Usage.java | 45 + .../generated/models/UsageListResult.java | 51 + .../storage/generated/models/UsageName.java | 50 + .../storage/generated/models/UsageUnit.java | 62 + .../storage/generated/models/Usages.java | 36 + .../models/UserAssignedIdentity.java | 50 + .../generated/models/VirtualNetworkRule.java | 110 + .../generated/models/package-info.java | 6 + .../storage/generated/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../BlobContainersClearLegalHoldSamples.java | 31 + ...eateOrUpdateImmutabilityPolicySamples.java | 46 + .../BlobContainersCreateSamples.java | 59 + ...ainersDeleteImmutabilityPolicySamples.java | 25 + .../BlobContainersDeleteSamples.java | 22 + ...ainersExtendImmutabilityPolicySamples.java | 31 + ...ontainersGetImmutabilityPolicySamples.java | 24 + .../generated/BlobContainersGetSamples.java | 35 + .../generated/BlobContainersLeaseSamples.java | 52 + .../generated/BlobContainersListSamples.java | 35 + ...ntainersLockImmutabilityPolicySamples.java | 25 + .../BlobContainersObjectLevelWormSamples.java | 23 + .../BlobContainersSetLegalHoldSamples.java | 53 + .../BlobContainersUpdateSamples.java | 39 + ...nventoryPoliciesCreateOrUpdateSamples.java | 288 + .../BlobInventoryPoliciesDeleteSamples.java | 26 + .../BlobInventoryPoliciesGetSamples.java | 26 + .../BlobInventoryPoliciesListSamples.java | 23 + ...obServicesGetServicePropertiesSamples.java | 22 + .../generated/BlobServicesListSamples.java | 22 + ...obServicesSetServicePropertiesSamples.java | 115 + .../generated/DeletedAccountsGetSamples.java | 22 + .../generated/DeletedAccountsListSamples.java | 22 + .../generated/EncryptionScopesGetSamples.java | 25 + .../EncryptionScopesListSamples.java | 23 + .../EncryptionScopesPatchSamples.java | 38 + .../generated/EncryptionScopesPutSamples.java | 43 + ...leServicesGetServicePropertiesSamples.java | 22 + .../generated/FileServicesListSamples.java | 22 + ...leServicesSetServicePropertiesSamples.java | 111 + .../generated/FileSharesCreateSamples.java | 57 + .../generated/FileSharesDeleteSamples.java | 22 + .../generated/FileSharesGetSamples.java | 34 + .../generated/FileSharesLeaseSamples.java | 54 + .../generated/FileSharesListSamples.java | 46 + .../generated/FileSharesRestoreSamples.java | 30 + .../generated/FileSharesUpdateSamples.java | 68 + ...alUsersOperationCreateOrUpdateSamples.java | 59 + .../LocalUsersOperationDeleteSamples.java | 22 + .../LocalUsersOperationGetSamples.java | 22 + .../LocalUsersOperationListKeysSamples.java | 22 + .../LocalUsersOperationListSamples.java | 22 + ...ersOperationRegeneratePasswordSamples.java | 22 + ...nagementPoliciesCreateOrUpdateSamples.java | 377 ++ .../ManagementPoliciesDeleteSamples.java | 26 + .../ManagementPoliciesGetSamples.java | 24 + ...oliciesOperationCreateOrUpdateSamples.java | 140 + ...icationPoliciesOperationDeleteSamples.java | 25 + ...eplicationPoliciesOperationGetSamples.java | 25 + ...plicationPoliciesOperationListSamples.java | 23 + .../generated/OperationsListSamples.java | 22 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...PrivateEndpointConnectionsListSamples.java | 23 + .../PrivateEndpointConnectionsPutSamples.java | 32 + ...kResourcesListByStorageAccountSamples.java | 23 + .../generated/QueueCreateSamples.java | 52 + .../generated/QueueDeleteSamples.java | 22 + .../generated/generated/QueueGetSamples.java | 22 + .../generated/generated/QueueListSamples.java | 22 + ...ueServicesGetServicePropertiesSamples.java | 22 + .../generated/QueueServicesListSamples.java | 22 + ...ueServicesSetServicePropertiesSamples.java | 64 + .../generated/QueueUpdateSamples.java | 25 + .../generated/generated/SkusListSamples.java | 22 + ...HierarchicalNamespaceMigrationSamples.java | 23 + ...eAccountsCheckNameAvailabilitySamples.java | 27 + .../StorageAccountsCreateSamples.java | 543 ++ .../StorageAccountsDeleteSamples.java | 22 + .../StorageAccountsFailoverSamples.java | 22 + ...rageAccountsGetByResourceGroupSamples.java | 61 + ...HierarchicalNamespaceMigrationSamples.java | 25 + .../StorageAccountsListAccountSasSamples.java | 42 + ...ageAccountsListByResourceGroupSamples.java | 23 + .../StorageAccountsListKeysSamples.java | 22 + .../generated/StorageAccountsListSamples.java | 22 + .../StorageAccountsListServiceSasSamples.java | 37 + .../StorageAccountsRegenerateKeySamples.java | 42 + ...orageAccountsRestoreBlobRangesSamples.java | 40 + ...countsRevokeUserDelegationKeysSamples.java | 23 + .../StorageAccountsUpdateSamples.java | 386 ++ .../generated/TableCreateSamples.java | 59 + .../generated/TableDeleteSamples.java | 22 + .../generated/generated/TableGetSamples.java | 22 + .../generated/generated/TableListSamples.java | 22 + ...leServicesGetServicePropertiesSamples.java | 22 + .../generated/TableServicesListSamples.java | 22 + ...leServicesSetServicePropertiesSamples.java | 64 + .../generated/TableUpdateSamples.java | 61 + .../UsagesListByLocationSamples.java | 22 + sdk/storage/ci.yml | 89 +- sdk/storage/pom.xml | 21 +- 504 files changed, 80077 insertions(+), 51 deletions(-) create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/README.md create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/pom.xml create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java create mode 100644 sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 487e3a353ce16..80c0c35de2c87 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -362,6 +362,7 @@ com.azure.resourcemanager:azure-resourcemanager-orbital;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-networkfunction;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-resourceconnector;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-fluidrelay;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-storage-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md b/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md new file mode 100644 index 0000000000000..04cc4acba06c7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-08-10) + +- Azure Resource Manager Storage client library for Java. This package contains Microsoft Azure SDK for Storage Management SDK. The Azure Storage Management API. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/storage/azure-resourcemanager-storage-generated/README.md b/sdk/storage/azure-resourcemanager-storage-generated/README.md new file mode 100644 index 0000000000000..f15ae32bd77c9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Storage client library for Java + +Azure Resource Manager Storage client library for Java. + +This package contains Microsoft Azure SDK for Storage Management SDK. The Azure Storage Management API. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-storage-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-storage-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +StorageManager manager = StorageManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md b/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md new file mode 100644 index 0000000000000..af1fefb755395 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md @@ -0,0 +1,4631 @@ +# Code snippets and samples + + +## BlobContainers + +- [ClearLegalHold](#blobcontainers_clearlegalhold) +- [Create](#blobcontainers_create) +- [CreateOrUpdateImmutabilityPolicy](#blobcontainers_createorupdateimmutabilitypolicy) +- [Delete](#blobcontainers_delete) +- [DeleteImmutabilityPolicy](#blobcontainers_deleteimmutabilitypolicy) +- [ExtendImmutabilityPolicy](#blobcontainers_extendimmutabilitypolicy) +- [Get](#blobcontainers_get) +- [GetImmutabilityPolicy](#blobcontainers_getimmutabilitypolicy) +- [Lease](#blobcontainers_lease) +- [List](#blobcontainers_list) +- [LockImmutabilityPolicy](#blobcontainers_lockimmutabilitypolicy) +- [ObjectLevelWorm](#blobcontainers_objectlevelworm) +- [SetLegalHold](#blobcontainers_setlegalhold) +- [Update](#blobcontainers_update) + +## BlobInventoryPolicies + +- [CreateOrUpdate](#blobinventorypolicies_createorupdate) +- [Delete](#blobinventorypolicies_delete) +- [Get](#blobinventorypolicies_get) +- [List](#blobinventorypolicies_list) + +## BlobServices + +- [GetServiceProperties](#blobservices_getserviceproperties) +- [List](#blobservices_list) +- [SetServiceProperties](#blobservices_setserviceproperties) + +## DeletedAccounts + +- [Get](#deletedaccounts_get) +- [List](#deletedaccounts_list) + +## EncryptionScopes + +- [Get](#encryptionscopes_get) +- [List](#encryptionscopes_list) +- [Patch](#encryptionscopes_patch) +- [Put](#encryptionscopes_put) + +## FileServices + +- [GetServiceProperties](#fileservices_getserviceproperties) +- [List](#fileservices_list) +- [SetServiceProperties](#fileservices_setserviceproperties) + +## FileShares + +- [Create](#fileshares_create) +- [Delete](#fileshares_delete) +- [Get](#fileshares_get) +- [Lease](#fileshares_lease) +- [List](#fileshares_list) +- [Restore](#fileshares_restore) +- [Update](#fileshares_update) + +## LocalUsersOperation + +- [CreateOrUpdate](#localusersoperation_createorupdate) +- [Delete](#localusersoperation_delete) +- [Get](#localusersoperation_get) +- [List](#localusersoperation_list) +- [ListKeys](#localusersoperation_listkeys) +- [RegeneratePassword](#localusersoperation_regeneratepassword) + +## ManagementPolicies + +- [CreateOrUpdate](#managementpolicies_createorupdate) +- [Delete](#managementpolicies_delete) +- [Get](#managementpolicies_get) + +## ObjectReplicationPoliciesOperation + +- [CreateOrUpdate](#objectreplicationpoliciesoperation_createorupdate) +- [Delete](#objectreplicationpoliciesoperation_delete) +- [Get](#objectreplicationpoliciesoperation_get) +- [List](#objectreplicationpoliciesoperation_list) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByStorageAccount](#privatelinkresources_listbystorageaccount) + +## Queue + +- [Create](#queue_create) +- [Delete](#queue_delete) +- [Get](#queue_get) +- [List](#queue_list) +- [Update](#queue_update) + +## QueueServices + +- [GetServiceProperties](#queueservices_getserviceproperties) +- [List](#queueservices_list) +- [SetServiceProperties](#queueservices_setserviceproperties) + +## Skus + +- [List](#skus_list) + +## StorageAccounts + +- [AbortHierarchicalNamespaceMigration](#storageaccounts_aborthierarchicalnamespacemigration) +- [CheckNameAvailability](#storageaccounts_checknameavailability) +- [Create](#storageaccounts_create) +- [Delete](#storageaccounts_delete) +- [Failover](#storageaccounts_failover) +- [GetByResourceGroup](#storageaccounts_getbyresourcegroup) +- [HierarchicalNamespaceMigration](#storageaccounts_hierarchicalnamespacemigration) +- [List](#storageaccounts_list) +- [ListAccountSas](#storageaccounts_listaccountsas) +- [ListByResourceGroup](#storageaccounts_listbyresourcegroup) +- [ListKeys](#storageaccounts_listkeys) +- [ListServiceSas](#storageaccounts_listservicesas) +- [RegenerateKey](#storageaccounts_regeneratekey) +- [RestoreBlobRanges](#storageaccounts_restoreblobranges) +- [RevokeUserDelegationKeys](#storageaccounts_revokeuserdelegationkeys) +- [Update](#storageaccounts_update) + +## Table + +- [Create](#table_create) +- [Delete](#table_delete) +- [Get](#table_get) +- [List](#table_list) +- [Update](#table_update) + +## TableServices + +- [GetServiceProperties](#tableservices_getserviceproperties) +- [List](#tableservices_list) +- [SetServiceProperties](#tableservices_setserviceproperties) + +## Usages + +- [ListByLocation](#usages_listbylocation) +### BlobContainers_ClearLegalHold + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** Samples for BlobContainers ClearLegalHold. */ +public final class BlobContainersClearLegalHoldSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersClearLegalHold.json + */ + /** + * Sample code: ClearLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void clearLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .clearLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), + Context.NONE); + } +} +``` + +### BlobContainers_Create + +```java +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; + +/** Samples for BlobContainers Create. */ +public final class BlobContainersCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutDefaultEncryptionScope.json + */ + /** + * Sample code: PutContainerWithDefaultEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainerWithDefaultEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withDefaultEncryptionScope("encryptionscope185") + .withDenyEncryptionScopeOverride(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutObjectLevelWorm.json + */ + /** + * Sample code: PutContainerWithObjectLevelWorm. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainerWithObjectLevelWorm( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withImmutableStorageWithVersioning(new ImmutableStorageWithVersioning().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPut.json + */ + /** + * Sample code: PutContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().define("container6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} +``` + +### BlobContainers_CreateOrUpdateImmutabilityPolicy + +```java +/** Samples for BlobContainers CreateOrUpdateImmutabilityPolicy. */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutImmutabilityPolicy.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWrites(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutImmutabilityPolicyAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWritesAll(true) + .create(); + } +} +``` + +### BlobContainers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers Delete. */ +public final class BlobContainersDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersDelete.json + */ + /** + * Sample code: DeleteContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().deleteWithResponse("res4079", "sto4506", "container9689", Context.NONE); + } +} +``` + +### BlobContainers_DeleteImmutabilityPolicy + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers DeleteImmutabilityPolicy. */ +public final class BlobContainersDeleteImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersDeleteImmutabilityPolicy.json + */ + /** + * Sample code: DeleteImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .deleteImmutabilityPolicyWithResponse( + "res1581", "sto9621", "container4910", "\"8d59f81a7fa7be0\"", Context.NONE); + } +} +``` + +### BlobContainers_ExtendImmutabilityPolicy + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Samples for BlobContainers ExtendImmutabilityPolicy. */ +public final class BlobContainersExtendImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersExtendImmutabilityPolicy.json + */ + /** + * Sample code: ExtendImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void extendImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .extendImmutabilityPolicyWithResponse( + "res6238", + "sto232", + "container5023", + "\"8d59f830d0c3bf9\"", + new ImmutabilityPolicyInner().withImmutabilityPeriodSinceCreationInDays(100), + Context.NONE); + } +} +``` + +### BlobContainers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers Get. */ +public final class BlobContainersGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGet.json + */ + /** + * Sample code: GetContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void getContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().getWithResponse("res9871", "sto6217", "container1634", Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGetWithAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: GetBlobContainersGetWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobContainersGetWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().getWithResponse("res9871", "sto6217", "container1634", Context.NONE); + } +} +``` + +### BlobContainers_GetImmutabilityPolicy + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers GetImmutabilityPolicy. */ +public final class BlobContainersGetImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGetImmutabilityPolicy.json + */ + /** + * Sample code: GetImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void getImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .getImmutabilityPolicyWithResponse("res5221", "sto9177", "container3489", null, Context.NONE); + } +} +``` + +### BlobContainers_Lease + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequestAction; + +/** Samples for BlobContainers Lease. */ +public final class BlobContainersLeaseSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLease_Break.json + */ + /** + * Sample code: Break a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .leaseWithResponse( + "res3376", + "sto328", + "container6185", + new LeaseContainerRequest() + .withAction(LeaseContainerRequestAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .leaseWithResponse( + "res3376", + "sto328", + "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.ACQUIRE).withLeaseDuration(-1), + Context.NONE); + } +} +``` + +### BlobContainers_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** Samples for BlobContainers List. */ +public final class BlobContainersListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersList.json + */ + /** + * Sample code: ListContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedBlobContainersList.json + */ + /** + * Sample code: ListDeletedContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, ListContainersInclude.DELETED, Context.NONE); + } +} +``` + +### BlobContainers_LockImmutabilityPolicy + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers LockImmutabilityPolicy. */ +public final class BlobContainersLockImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLockImmutabilityPolicy.json + */ + /** + * Sample code: LockImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void lockImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .lockImmutabilityPolicyWithResponse( + "res2702", "sto5009", "container1631", "\"8d59f825b721dd3\"", Context.NONE); + } +} +``` + +### BlobContainers_ObjectLevelWorm + +```java +import com.azure.core.util.Context; + +/** Samples for BlobContainers ObjectLevelWorm. */ +public final class BlobContainersObjectLevelWormSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/ObjectLevelWormContainerMigration.json + */ + /** + * Sample code: VersionLevelWormContainerMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void versionLevelWormContainerMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().objectLevelWorm("res1782", "sto7069", "container6397", Context.NONE); + } +} +``` + +### BlobContainers_SetLegalHold + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** Samples for BlobContainers SetLegalHold. */ +public final class BlobContainersSetLegalHoldSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersSetLegalHold.json + */ + /** + * Sample code: SetLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .setLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersSetLegalHoldAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: SetLegalHoldContainersWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainersWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .setLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner() + .withTags(Arrays.asList("tag1", "tag2", "tag3")) + .withAllowProtectedAppendWritesAll(true), + Context.NONE); + } +} +``` + +### BlobContainers_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BlobContainers Update. */ +public final class BlobContainersUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPatch.json + */ + /** + * Sample code: UpdateContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void updateContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + BlobContainer resource = + manager.blobContainers().getWithResponse("res3376", "sto328", "container6185", Context.NONE).getValue(); + resource.update().withPublicAccess(PublicAccess.CONTAINER).withMetadata(mapOf("metadata", "true")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BlobInventoryPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyRule; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.azure.resourcemanager.storage.generated.models.Format; +import com.azure.resourcemanager.storage.generated.models.InventoryRuleType; +import com.azure.resourcemanager.storage.generated.models.ObjectType; +import com.azure.resourcemanager.storage.generated.models.Schedule; +import java.util.Arrays; + +/** Samples for BlobInventoryPolicies CreateOrUpdate. */ +public final class BlobInventoryPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "Tags", + "ContentType", + "ContentEncoding", + "ContentLanguage", + "ContentCRC64", + "CacheControl", + "Metadata", + "Deleted", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold", + "Etag", + "DefaultEncryptionScope", + "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", + "Deleted", + "Version", + "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "Metadata"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "ContentType", + "ContentEncoding", + "ContentLanguage", + "ContentCRC64", + "CacheControl", + "Metadata", + "DeletionId", + "Deleted", + "DeletedTime", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold", + "Etag", + "DefaultEncryptionScope", + "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", + "Deleted", + "Version", + "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } +} +``` + +### BlobInventoryPolicies_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** Samples for BlobInventoryPolicies Delete. */ +public final class BlobInventoryPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountDeleteBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .deleteWithResponse("res6977", "sto2527", BlobInventoryPolicyName.DEFAULT, Context.NONE); + } +} +``` + +### BlobInventoryPolicies_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** Samples for BlobInventoryPolicies Get. */ +public final class BlobInventoryPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .getWithResponse("res7687", "sto9699", BlobInventoryPolicyName.DEFAULT, Context.NONE); + } +} +``` + +### BlobInventoryPolicies_List + +```java +import com.azure.core.util.Context; + +/** Samples for BlobInventoryPolicies List. */ +public final class BlobInventoryPoliciesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies().list("res7687", "sto9699", Context.NONE); + } +} +``` + +### BlobServices_GetServiceProperties + +```java +import com.azure.core.util.Context; + +/** Samples for BlobServices GetServiceProperties. */ +public final class BlobServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesGet.json + */ + /** + * Sample code: GetBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} +``` + +### BlobServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for BlobServices List. */ +public final class BlobServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesList.json + */ + /** + * Sample code: ListBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().list("res4410", "sto8607", Context.NONE); + } +} +``` + +### BlobServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.Name; +import java.util.Arrays; + +/** Samples for BlobServices SetServiceProperties. */ +public final class BlobServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPut.json + */ + /** + * Sample code: PutBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x -ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .withDefaultServiceVersion("2017-07-29") + .withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(true).withDays(300)) + .withIsVersioningEnabled(true) + .withChangeFeed(new ChangeFeed().withEnabled(true).withRetentionInDays(7)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPutAllowPermanentDelete.json + */ + /** + * Sample code: BlobServicesPutAllowPermanentDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void blobServicesPutAllowPermanentDelete( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withDeleteRetentionPolicy( + new DeleteRetentionPolicy().withEnabled(true).withDays(300).withAllowPermanentDelete(true)) + .withIsVersioningEnabled(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPutLastAccessTimeBasedTracking.json + */ + /** + * Sample code: BlobServicesPutLastAccessTimeBasedTracking. + * + * @param manager Entry point to StorageManager. + */ + public static void blobServicesPutLastAccessTimeBasedTracking( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withLastAccessTimeTrackingPolicy( + new LastAccessTimeTrackingPolicy() + .withEnable(true) + .withName(Name.ACCESS_TIME_TRACKING) + .withTrackingGranularityInDays(1) + .withBlobType(Arrays.asList("blockBlob"))) + .create(); + } +} +``` + +### DeletedAccounts_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedAccounts Get. */ +public final class DeletedAccountsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedAccountGet.json + */ + /** + * Sample code: DeletedAccountGet. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().getWithResponse("sto1125", "eastus", Context.NONE); + } +} +``` + +### DeletedAccounts_List + +```java +import com.azure.core.util.Context; + +/** Samples for DeletedAccounts List. */ +public final class DeletedAccountsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedAccountList.json + */ + /** + * Sample code: DeletedAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().list(Context.NONE); + } +} +``` + +### EncryptionScopes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EncryptionScopes Get. */ +public final class EncryptionScopesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetEncryptionScope.json + */ + /** + * Sample code: StorageAccountGetEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .getWithResponse("resource-group-name", "{storage-account-name}", "{encryption-scope-name}", Context.NONE); + } +} +``` + +### EncryptionScopes_List + +```java +import com.azure.core.util.Context; + +/** Samples for EncryptionScopes List. */ +public final class EncryptionScopesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEncryptionScopeList.json + */ + /** + * Sample code: StorageAccountEncryptionScopeList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEncryptionScopeList( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes().list("resource-group-name", "{storage-account-name}", Context.NONE); + } +} +``` + +### EncryptionScopes_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; + +/** Samples for EncryptionScopes Patch. */ +public final class EncryptionScopesPatchSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPatchEncryptionScope.json + */ + /** + * Sample code: StorageAccountPatchEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPatchEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + EncryptionScope resource = + manager + .encryptionScopes() + .getWithResponse( + "resource-group-name", "{storage-account-name}", "{encryption-scope-name}", Context.NONE) + .getValue(); + resource + .update() + .withSource(EncryptionScopeSource.MICROSOFT_KEY_VAULT) + .withKeyVaultProperties( + new EncryptionScopeKeyVaultProperties() + .withKeyUri("https://testvault.vault.core.windows.net/keys/key1/863425f1358359c")) + .apply(); + } +} +``` + +### EncryptionScopes_Put + +```java +/** Samples for EncryptionScopes Put. */ +public final class EncryptionScopesPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutEncryptionScopeWithInfrastructureEncryption.json + */ + /** + * Sample code: StorageAccountPutEncryptionScopeWithInfrastructureEncryption. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScopeWithInfrastructureEncryption( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "{storage-account-name}") + .withRequireInfrastructureEncryption(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutEncryptionScope.json + */ + /** + * Sample code: StorageAccountPutEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "{storage-account-name}") + .create(); + } +} +``` + +### FileServices_GetServiceProperties + +```java +import com.azure.core.util.Context; + +/** Samples for FileServices GetServiceProperties. */ +public final class FileServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesGet.json + */ + /** + * Sample code: GetFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} +``` + +### FileServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for FileServices List. */ +public final class FileServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesList.json + */ + /** + * Sample code: ListFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} +``` + +### FileServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.Multichannel; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.SmbSetting; +import java.util.Arrays; + +/** Samples for FileServices SetServiceProperties. */ +public final class FileServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut.json + */ + /** + * Sample code: PutFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut_EnableSecureSmbFeatures.json + */ + /** + * Sample code: PutFileServices_EnableSecureSmbFeatures. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServicesEnableSecureSmbFeatures( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings() + .withSmb( + new SmbSetting() + .withVersions("SMB2.1;SMB3.0;SMB3.1.1") + .withAuthenticationMethods("NTLMv2;Kerberos") + .withKerberosTicketEncryption("RC4-HMAC;AES-256") + .withChannelEncryption("AES-128-CCM;AES-128-GCM;AES-256-GCM"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut_EnableSMBMultichannel.json + */ + /** + * Sample code: PutFileServices_EnableSMBMultichannel. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServicesEnableSMBMultichannel( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings().withSmb(new SmbSetting().withMultichannel(new Multichannel().withEnabled(true)))) + .create(); + } +} +``` + +### FileShares_Create + +```java +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; + +/** Samples for FileShares Create. */ +public final class FileSharesCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut_AccessTier.json + */ + /** + * Sample code: PutShares with Access Tier. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithAccessTier(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withAccessTier(ShareAccessTier.HOT) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut_NFS.json + */ + /** + * Sample code: Create NFS Shares. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withEnabledProtocols(EnabledProtocols.NFS) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut.json + */ + /** + * Sample code: PutShares. + * + * @param manager Entry point to StorageManager. + */ + public static void putShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().define("share6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} +``` + +### FileShares_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for FileShares Delete. */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesDelete.json + */ + /** + * Sample code: DeleteShares. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().deleteWithResponse("res4079", "sto4506", "share9689", null, null, Context.NONE); + } +} +``` + +### FileShares_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FileShares Get. */ +public final class FileSharesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesGet_Stats.json + */ + /** + * Sample code: GetShareStats. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareStats(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().getWithResponse("res9871", "sto6217", "share1634", "stats", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesGet.json + */ + /** + * Sample code: GetShares. + * + * @param manager Entry point to StorageManager. + */ + public static void getShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().getWithResponse("res9871", "sto6217", "share1634", null, null, Context.NONE); + } +} +``` + +### FileShares_Lease + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LeaseShareAction; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** Samples for FileShares Lease. */ +public final class FileSharesLeaseSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesLease_Break.json + */ + /** + * Sample code: Break a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .leaseWithResponse( + "res3376", + "sto328", + "share12", + null, + new LeaseShareRequest() + .withAction(LeaseShareAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .leaseWithResponse( + "res3376", + "sto328", + "share124", + null, + new LeaseShareRequest().withAction(LeaseShareAction.ACQUIRE).withLeaseDuration(-1), + Context.NONE); + } +} +``` + +### FileShares_List + +```java +import com.azure.core.util.Context; + +/** Samples for FileShares List. */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesList.json + */ + /** + * Sample code: ListShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedFileSharesList.json + */ + /** + * Sample code: ListDeletedShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "deleted", Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileShareSnapshotsList.json + */ + /** + * Sample code: ListShareSnapshots. + * + * @param manager Entry point to StorageManager. + */ + public static void listShareSnapshots(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "snapshots", Context.NONE); + } +} +``` + +### FileShares_Restore + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; + +/** Samples for FileShares Restore. */ +public final class FileSharesRestoreSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesRestore.json + */ + /** + * Sample code: RestoreShares. + * + * @param manager Entry point to StorageManager. + */ + public static void restoreShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .restoreWithResponse( + "res3376", + "sto328", + "share1249", + new DeletedShare().withDeletedShareName("share1249").withDeletedShareVersion("1234567890"), + Context.NONE); + } +} +``` + +### FileShares_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccessPolicy; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FileShares Update. */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPatch.json + */ + /** + * Sample code: UpdateShares. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = + manager.fileShares().getWithResponse("res3376", "sto328", "share6185", null, null, Context.NONE).getValue(); + resource.update().withMetadata(mapOf("type", "image")).apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileShareAclsPatch.json + */ + /** + * Sample code: UpdateShareAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = + manager.fileShares().getWithResponse("res3376", "sto328", "share6185", null, null, Context.NONE).getValue(); + resource + .update() + .withSignedIdentifiers( + Arrays + .asList( + new SignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new AccessPolicy() + .withStartTime(OffsetDateTime.parse("2021-04-01T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2021-05-01T08:49:37.0000000Z")) + .withPermission("rwd")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LocalUsersOperation_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Arrays; + +/** Samples for LocalUsersOperation CreateOrUpdate. */ +public final class LocalUsersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserCreate.json + */ + /** + * Sample code: CreateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withPermissionScopes( + Arrays + .asList( + new PermissionScope().withPermissions("rwd").withService("file").withResourceName("share1"), + new PermissionScope().withPermissions("rw").withService("file").withResourceName("share2"))) + .withHomeDirectory("homedirectory") + .withSshAuthorizedKeys( + Arrays.asList(new SshPublicKey().withDescription("key name").withKey("ssh-rsa keykeykeykeykey="))) + .withHasSshPassword(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserUpdate.json + */ + /** + * Sample code: UpdateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void updateLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + LocalUser resource = + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", Context.NONE).getValue(); + resource + .update() + .withHomeDirectory("homedirectory2") + .withHasSharedKey(false) + .withHasSshKey(false) + .withHasSshPassword(false) + .apply(); + } +} +``` + +### LocalUsersOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation Delete. */ +public final class LocalUsersOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserDelete.json + */ + /** + * Sample code: DeleteLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().deleteWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} +``` + +### LocalUsersOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation Get. */ +public final class LocalUsersOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserGet.json + */ + /** + * Sample code: GetLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void getLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} +``` + +### LocalUsersOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation List. */ +public final class LocalUsersOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUsersList.json + */ + /** + * Sample code: ListLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().list("res6977", "sto2527", Context.NONE); + } +} +``` + +### LocalUsersOperation_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation ListKeys. */ +public final class LocalUsersOperationListKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserListKeys.json + */ + /** + * Sample code: ListLocalUserKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUserKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().listKeysWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} +``` + +### LocalUsersOperation_RegeneratePassword + +```java +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation RegeneratePassword. */ +public final class LocalUsersOperationRegeneratePasswordSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserRegeneratePassword.json + */ + /** + * Sample code: RegenerateLocalUserPassword. + * + * @param manager Entry point to StorageManager. + */ + public static void regenerateLocalUserPassword(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().regeneratePasswordWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} +``` + +### ManagementPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.DateAfterCreation; +import com.azure.resourcemanager.storage.generated.models.DateAfterModification; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyAction; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyBaseBlob; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyRule; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySnapShot; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyVersion; +import com.azure.resourcemanager.storage.generated.models.RuleType; +import com.azure.resourcemanager.storage.generated.models.TagFilter; +import java.util.Arrays; + +/** Samples for ManagementPolicies CreateOrUpdate. */ +public final class ManagementPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicyWithSnapshotAndVersion.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyWithSnapshotAndVersion. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyWithSnapshotAndVersion( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withTierToCool( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(1000f))) + .withVersion( + new ManagementPolicyVersion() + .withTierToCool( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(1000f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicyForBlockAndAppendBlobs.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyForBlockAndAppendBlobs. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyForBlockAndAppendBlobs( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f))) + .withVersion( + new ManagementPolicyVersion() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastAccessTimeBasedBlobActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(1000.0F)) + .withEnableAutoTierToHotFromCool(true)) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy.json + */ + /** + * Sample code: StorageAccountSetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob")))), + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest2") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer2")) + .withBlobTypes(Arrays.asList("blockBlob")) + .withBlobIndexMatch( + Arrays + .asList( + new TagFilter() + .withName("tag1") + .withOp("==") + .withValue("val1"), + new TagFilter() + .withName("tag2") + .withOp("==") + .withValue("val2")))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyBaseBlobDaysAfterCreationActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(1000.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_LastTierChangeTimeActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastTierChangeTimeActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastTierChangeTimeActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F) + .withDaysAfterLastTierChangeGreaterThan(120.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F))) + .withVersion( + new ManagementPolicyVersion() + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } +} +``` + +### ManagementPolicies_Delete + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** Samples for ManagementPolicies Delete. */ +public final class ManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteManagementPolicy.json + */ + /** + * Sample code: StorageAccountDeleteManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .deleteWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, Context.NONE); + } +} +``` + +### ManagementPolicies_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** Samples for ManagementPolicies Get. */ +public final class ManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetManagementPolicy.json + */ + /** + * Sample code: StorageAccountGetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies().getWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.util.Arrays; + +/** Samples for ObjectReplicationPoliciesOperation CreateOrUpdate. */ +public final class ObjectReplicationPoliciesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .define("2a20bb73-5717-4635-985a-5d4cf777438f") + .withExistingStorageAccount("res7687", "src1122") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter() + .withPrefixMatch(Arrays.asList("blobA", "blobB")) + .withMinCreationTime("2020-02-19T16:05:00Z")))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .define("default") + .withExistingStorageAccount("res7687", "dst112") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res7687", "dst112", "2a20bb73-5717-4635-985a-5d4cf777438f", Context.NONE) + .getValue(); + resource + .update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule() + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res7687", "src1122", "2a20bb73-5717-4635-985a-5d4cf777438f", Context.NONE) + .getValue(); + resource + .update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule() + .withRuleId("cfbb4bc2-8b60-429f-b05a-d1e0942b33b2") + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .apply(); + } +} +``` + +### ObjectReplicationPoliciesOperation_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation Delete. */ +public final class ObjectReplicationPoliciesOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountDeleteObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .deleteWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation Get. */ +public final class ObjectReplicationPoliciesOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountGetObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation List. */ +public final class ObjectReplicationPoliciesOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListObjectReplicationPolicies.json + */ + /** + * Sample code: StorageAccountListObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations().list("res6977", "sto2527", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageManager. + */ + public static void operationsList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeletePrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountDeletePrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeletePrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountGetPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListPrivateEndpointConnections.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountPutPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutPrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageAccount("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateLinkResources_ListByStorageAccount + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByStorageAccount. */ +public final class PrivateLinkResourcesListByStorageAccountSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateLinkResources( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateLinkResources().listByStorageAccountWithResponse("res6977", "sto2527", Context.NONE); + } +} +``` + +### Queue_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for Queue Create. */ +public final class QueueCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPut.json + */ + /** + * Sample code: QueueOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().define("queue6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPutWithMetadata.json + */ + /** + * Sample code: QueueOperationPutWithMetadata. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPutWithMetadata( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .queues() + .define("queue6185") + .withExistingStorageAccount("res3376", "sto328") + .withMetadata(mapOf("sample1", "meta1", "sample2", "meta2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Queue_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Queue Delete. */ +public final class QueueDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationDelete.json + */ + /** + * Sample code: QueueOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().deleteWithResponse("res3376", "sto328", "queue6185", Context.NONE); + } +} +``` + +### Queue_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Queue Get. */ +public final class QueueGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationGet.json + */ + /** + * Sample code: QueueOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().getWithResponse("res3376", "sto328", "queue6185", Context.NONE); + } +} +``` + +### Queue_List + +```java +import com.azure.core.util.Context; + +/** Samples for Queue List. */ +public final class QueueListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationList.json + */ + /** + * Sample code: QueueOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().list("res9290", "sto328", null, null, Context.NONE); + } +} +``` + +### Queue_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +/** Samples for Queue Update. */ +public final class QueueUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPatch.json + */ + /** + * Sample code: QueueOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageQueue resource = + manager.queues().getWithResponse("res3376", "sto328", "queue6185", Context.NONE).getValue(); + resource.update().apply(); + } +} +``` + +### QueueServices_GetServiceProperties + +```java +import com.azure.core.util.Context; + +/** Samples for QueueServices GetServiceProperties. */ +public final class QueueServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesGet.json + */ + /** + * Sample code: QueueServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} +``` + +### QueueServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for QueueServices List. */ +public final class QueueServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesList.json + */ + /** + * Sample code: QueueServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} +``` + +### QueueServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** Samples for QueueServices SetServiceProperties. */ +public final class QueueServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesPut.json + */ + /** + * Sample code: QueueServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .queueServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/SKUList.json + */ + /** + * Sample code: SkuList. + * + * @param manager Entry point to StorageManager. + */ + public static void skuList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.skus().list(Context.NONE); + } +} +``` + +### StorageAccounts_AbortHierarchicalNamespaceMigration + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts AbortHierarchicalNamespaceMigration. */ +public final class StorageAccountsAbortHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountAbortHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountAbortHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().abortHierarchicalNamespaceMigration("res4228", "sto2434", Context.NONE); + } +} +``` + +### StorageAccounts_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; + +/** Samples for StorageAccounts CheckNameAvailability. */ +public final class StorageAccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCheckNameAvailability.json + */ + /** + * Sample code: StorageAccountCheckNameAvailability. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCheckNameAvailability( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .checkNameAvailabilityWithResponse( + new StorageAccountCheckNameAvailabilityParameters().withName("sto3363"), Context.NONE); + } +} +``` + +### StorageAccounts_Create + +```java +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.Bypass; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.storage.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAccounts Create. */ +public final class StorageAccountsCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/NfsV3AccountCreate.json + */ + /** + * Sample code: NfsV3AccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void nfsV3AccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withNetworkRuleSet( + new NetworkRuleSet() + .withBypass(Bypass.AZURE_SERVICES) + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withVirtualNetworkResourceId( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))) + .withIpRules(Arrays.asList()) + .withDefaultAction(DefaultAction.ALLOW)) + .withEnableHttpsTrafficOnly(false) + .withIsHnsEnabled(true) + .withEnableNfsV3(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreatePremiumBlockBlobStorage.json + */ + /** + * Sample code: StorageAccountCreatePremiumBlockBlobStorage. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreatePremiumBlockBlobStorage( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountCreateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateWithImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withImmutableStorageWithVersioning( + new ImmutableStorageAccount() + .withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties() + .withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.UNLOCKED) + .withAllowProtectedAppendWrites(true))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateAllowedCopyScopeToPrivateLink.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToPrivateLink. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToPrivateLink( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withAllowedCopyScope(AllowedCopyScope.PRIVATE_LINK) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreate.json + */ + /** + * Sample code: StorageAccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateEnablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateEnablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateEnablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToAAD( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto131918") + .withRegion("eastus") + .withExistingResourceGroup("res131918") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("f83c6b1b-4d34-47e4-bb34-9d83df58b540"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDisallowPublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateDisallowPublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDisallowPublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDnsEndpointTypeToStandard.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToStandard. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToStandard( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.STANDARD) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDnsEndpointTypeToAzureDnsZone.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToAzureDnsZone. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToAzureDnsZone( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.AZURE_DNS_ZONE) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageAccounts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts Delete. */ +public final class StorageAccountsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDelete.json + */ + /** + * Sample code: StorageAccountDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().deleteWithResponse("res4228", "sto2434", Context.NONE); + } +} +``` + +### StorageAccounts_Failover + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts Failover. */ +public final class StorageAccountsFailoverSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountFailover.json + */ + /** + * Sample code: StorageAccountFailover. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountFailover(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().failover("res4228", "sto2434", Context.NONE); + } +} +``` + +### StorageAccounts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts GetByResourceGroup. */ +public final class StorageAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetProperties.json + */ + /** + * Sample code: StorageAccountGetProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPropertiesCMKVersionExpirationTime.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKVersionExpirationTime. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKVersionExpirationTime( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetAsyncSkuConversionStatus.json + */ + /** + * Sample code: StorageAccountGetAsyncSkuConversionStatus. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetAsyncSkuConversionStatus( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPropertiesCMKEnabled.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKEnabled. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKEnabled( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } +} +``` + +### StorageAccounts_HierarchicalNamespaceMigration + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts HierarchicalNamespaceMigration. */ +public final class StorageAccountsHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .hierarchicalNamespaceMigration("res4228", "sto2434", "HnsOnValidationRequest", Context.NONE); + } +} +``` + +### StorageAccounts_List + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts List. */ +public final class StorageAccountsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountList.json + */ + /** + * Sample code: StorageAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().list(Context.NONE); + } +} +``` + +### StorageAccounts_ListAccountSas + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.HttpProtocol; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.Services; +import com.azure.resourcemanager.storage.generated.models.SignedResourceTypes; +import java.time.OffsetDateTime; + +/** Samples for StorageAccounts ListAccountSas. */ +public final class StorageAccountsListAccountSasSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListAccountSAS.json + */ + /** + * Sample code: StorageAccountListAccountSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListAccountSAS( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .listAccountSasWithResponse( + "res7985", + "sto8588", + new AccountSasParameters() + .withServices(Services.B) + .withResourceTypes(SignedResourceTypes.S) + .withPermissions(Permissions.R) + .withProtocols(HttpProtocol.HTTPS_HTTP) + .withSharedAccessStartTime(OffsetDateTime.parse("2017-05-24T10:42:03.1567373Z")) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:42:03.1567373Z")) + .withKeyToSign("key1"), + Context.NONE); + } +} +``` + +### StorageAccounts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts ListByResourceGroup. */ +public final class StorageAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListByResourceGroup.json + */ + /** + * Sample code: StorageAccountListByResourceGroup. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListByResourceGroup( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listByResourceGroup("res6117", Context.NONE); + } +} +``` + +### StorageAccounts_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts ListKeys. */ +public final class StorageAccountsListKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListKeys.json + */ + /** + * Sample code: StorageAccountListKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listKeysWithResponse("res418", "sto2220", null, Context.NONE); + } +} +``` + +### StorageAccounts_ListServiceSas + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.SignedResource; +import java.time.OffsetDateTime; + +/** Samples for StorageAccounts ListServiceSas. */ +public final class StorageAccountsListServiceSasSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListServiceSAS.json + */ + /** + * Sample code: StorageAccountListServiceSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListServiceSAS( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .listServiceSasWithResponse( + "res7439", + "sto1299", + new ServiceSasParameters() + .withCanonicalizedResource("/blob/sto1299/music") + .withResource(SignedResource.C) + .withPermissions(Permissions.L) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:32:48.8457197Z")), + Context.NONE); + } +} +``` + +### StorageAccounts_RegenerateKey + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; + +/** Samples for StorageAccounts RegenerateKey. */ +public final class StorageAccountsRegenerateKeySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRegenerateKey.json + */ + /** + * Sample code: StorageAccountRegenerateKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .regenerateKeyWithResponse( + "res4167", "sto3539", new StorageAccountRegenerateKeyParameters().withKeyName("key2"), Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRegenerateKerbKey.json + */ + /** + * Sample code: StorageAccountRegenerateKerbKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKerbKey( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .regenerateKeyWithResponse( + "res4167", "sto3539", new StorageAccountRegenerateKeyParameters().withKeyName("kerb1"), Context.NONE); + } +} +``` + +### StorageAccounts_RestoreBlobRanges + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for StorageAccounts RestoreBlobRanges. */ +public final class StorageAccountsRestoreBlobRangesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobRangesRestore.json + */ + /** + * Sample code: BlobRangesRestore. + * + * @param manager Entry point to StorageManager. + */ + public static void blobRangesRestore(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .restoreBlobRanges( + "res9101", + "sto4445", + new BlobRestoreParameters() + .withTimeToRestore(OffsetDateTime.parse("2019-04-20T15:30:00.0000000Z")) + .withBlobRanges( + Arrays + .asList( + new BlobRestoreRange() + .withStartRange("container/blobpath1") + .withEndRange("container/blobpath2"), + new BlobRestoreRange().withStartRange("container2/blobpath3").withEndRange(""))), + Context.NONE); + } +} +``` + +### StorageAccounts_RevokeUserDelegationKeys + +```java +import com.azure.core.util.Context; + +/** Samples for StorageAccounts RevokeUserDelegationKeys. */ +public final class StorageAccountsRevokeUserDelegationKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRevokeUserDelegationKeys.json + */ + /** + * Sample code: StorageAccountRevokeUserDelegationKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRevokeUserDelegationKeys( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().revokeUserDelegationKeysWithResponse("res4167", "sto3539", Context.NONE); + } +} +``` + +### StorageAccounts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AccountType; +import com.azure.resourcemanager.storage.generated.models.ActiveDirectoryProperties; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DirectoryServiceOptions; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.ResourceAccessRule; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAccounts Update. */ +public final class StorageAccountsUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountUpdateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateWithImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withImmutableStorageWithVersioning( + new ImmutableStorageAccount() + .withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties() + .withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.LOCKED) + .withAllowProtectedAppendWrites(true))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res131918", "sto131918", null, Context.NONE) + .getValue(); + resource + .update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("3109d1c4-a5de-4d84-8832-feabb916a4b6"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEnableAD.json + */ + /** + * Sample code: StorageAccountEnableAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withAzureFilesIdentityBasedAuthentication( + new AzureFilesIdentityBasedAuthentication() + .withDirectoryServiceOptions(DirectoryServiceOptions.AD) + .withActiveDirectoryProperties( + new ActiveDirectoryProperties() + .withDomainName("adtest.com") + .withNetBiosDomainName("adtest.com") + .withForestName("adtest.com") + .withDomainGuid("aebfc118-9fa9-4732-a21f-d98e41a77ae1") + .withDomainSid("S-1-5-21-2400535526-2334094090-2402026252") + .withAzureStorageSid("S-1-5-21-2400535526-2334094090-2402026252-0012") + .withSamAccountName("sam12498") + .withAccountType(AccountType.USER))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountUpdateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateAllowedCopyScopeToAAD( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateDisablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountUpdateDisablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateDisablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEnableCMK.json + */ + /** + * Sample code: StorageAccountEnableCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableCMK(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdate.json + */ + /** + * Sample code: StorageAccountUpdate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withIsSftpEnabled(true) + .withIsLocalUserEnabled(true) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9101", "sto4445", null, Context.NONE) + .getValue(); + resource + .update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Table_Create + +```java +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Table Create. */ +public final class TableCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPut.json + */ + /** + * Sample code: TableOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().define("table6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPutOrPatchAcls.json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPutOrPatchAcls( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .tables() + .define("table6185") + .withExistingStorageAccount("res3376", "sto328") + .withSignedIdentifiers( + Arrays + .asList( + new TableSignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier() + .withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .create(); + } +} +``` + +### Table_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Table Delete. */ +public final class TableDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationDelete.json + */ + /** + * Sample code: TableOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().deleteWithResponse("res3376", "sto328", "table6185", Context.NONE); + } +} +``` + +### Table_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Table Get. */ +public final class TableGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationGet.json + */ + /** + * Sample code: TableOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE); + } +} +``` + +### Table_List + +```java +import com.azure.core.util.Context; + +/** Samples for Table List. */ +public final class TableListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationList.json + */ + /** + * Sample code: TableOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().list("res9290", "sto328", Context.NONE); + } +} +``` + +### Table_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Table Update. */ +public final class TableUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPutOrPatchAcls.json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPutOrPatchAcls( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE).getValue(); + resource + .update() + .withSignedIdentifiers( + Arrays + .asList( + new TableSignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier() + .withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPatch.json + */ + /** + * Sample code: TableOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE).getValue(); + resource.update().apply(); + } +} +``` + +### TableServices_GetServiceProperties + +```java +import com.azure.core.util.Context; + +/** Samples for TableServices GetServiceProperties. */ +public final class TableServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesGet.json + */ + /** + * Sample code: TableServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} +``` + +### TableServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for TableServices List. */ +public final class TableServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesList.json + */ + /** + * Sample code: TableServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} +``` + +### TableServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** Samples for TableServices SetServiceProperties. */ +public final class TableServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesPut.json + */ + /** + * Sample code: TableServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .tableServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} +``` + +### Usages_ListByLocation + +```java +import com.azure.core.util.Context; + +/** Samples for Usages ListByLocation. */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListLocationUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to StorageManager. + */ + public static void usageList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.usages().listByLocation("eastus2(stage)", Context.NONE); + } +} +``` + diff --git a/sdk/storage/azure-resourcemanager-storage-generated/pom.xml b/sdk/storage/azure-resourcemanager-storage-generated/pom.xml new file mode 100644 index 0000000000000..e311c972d5f2b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-storage-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Storage Management + This package contains Microsoft Azure SDK for Storage Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Storage Management API. Package tag package-2022-05. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.31.0 + + + com.azure + azure-core-management + 1.7.1 + + + diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java new file mode 100644 index 0000000000000..4e24af7de8f4c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.StorageManagementClient; +import com.azure.resourcemanager.storage.generated.implementation.BlobContainersImpl; +import com.azure.resourcemanager.storage.generated.implementation.BlobInventoryPoliciesImpl; +import com.azure.resourcemanager.storage.generated.implementation.BlobServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.DeletedAccountsImpl; +import com.azure.resourcemanager.storage.generated.implementation.EncryptionScopesImpl; +import com.azure.resourcemanager.storage.generated.implementation.FileServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.FileSharesImpl; +import com.azure.resourcemanager.storage.generated.implementation.LocalUsersOperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.ManagementPoliciesImpl; +import com.azure.resourcemanager.storage.generated.implementation.ObjectReplicationPoliciesOperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.storage.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.storage.generated.implementation.QueueServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.QueuesImpl; +import com.azure.resourcemanager.storage.generated.implementation.SkusImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageAccountsImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageManagementClientBuilder; +import com.azure.resourcemanager.storage.generated.implementation.TableServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.TablesImpl; +import com.azure.resourcemanager.storage.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.storage.generated.models.BlobContainers; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicies; +import com.azure.resourcemanager.storage.generated.models.BlobServices; +import com.azure.resourcemanager.storage.generated.models.DeletedAccounts; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopes; +import com.azure.resourcemanager.storage.generated.models.FileServices; +import com.azure.resourcemanager.storage.generated.models.FileShares; +import com.azure.resourcemanager.storage.generated.models.LocalUsersOperations; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicies; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPoliciesOperations; +import com.azure.resourcemanager.storage.generated.models.Operations; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.storage.generated.models.QueueServices; +import com.azure.resourcemanager.storage.generated.models.Queues; +import com.azure.resourcemanager.storage.generated.models.Skus; +import com.azure.resourcemanager.storage.generated.models.StorageAccounts; +import com.azure.resourcemanager.storage.generated.models.TableServices; +import com.azure.resourcemanager.storage.generated.models.Tables; +import com.azure.resourcemanager.storage.generated.models.Usages; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to StorageManager. The Azure Storage Management API. */ +public final class StorageManager { + private Operations operations; + + private Skus skus; + + private StorageAccounts storageAccounts; + + private DeletedAccounts deletedAccounts; + + private Usages usages; + + private ManagementPolicies managementPolicies; + + private BlobInventoryPolicies blobInventoryPolicies; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private ObjectReplicationPoliciesOperations objectReplicationPoliciesOperations; + + private LocalUsersOperations localUsersOperations; + + private EncryptionScopes encryptionScopes; + + private BlobServices blobServices; + + private BlobContainers blobContainers; + + private FileServices fileServices; + + private FileShares fileShares; + + private QueueServices queueServices; + + private Queues queues; + + private TableServices tableServices; + + private Tables tables; + + private final StorageManagementClient clientObject; + + private StorageManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new StorageManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Storage service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public static StorageManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Storage service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public static StorageManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new StorageManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new StorageManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Storage service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public StorageManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.storage.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new StorageManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * Gets the resource collection API of StorageAccounts. It manages StorageAccount. + * + * @return Resource collection API of StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(clientObject.getStorageAccounts(), this); + } + return storageAccounts; + } + + /** + * Gets the resource collection API of DeletedAccounts. + * + * @return Resource collection API of DeletedAccounts. + */ + public DeletedAccounts deletedAccounts() { + if (this.deletedAccounts == null) { + this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); + } + return deletedAccounts; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * Gets the resource collection API of ManagementPolicies. It manages ManagementPolicy. + * + * @return Resource collection API of ManagementPolicies. + */ + public ManagementPolicies managementPolicies() { + if (this.managementPolicies == null) { + this.managementPolicies = new ManagementPoliciesImpl(clientObject.getManagementPolicies(), this); + } + return managementPolicies; + } + + /** + * Gets the resource collection API of BlobInventoryPolicies. It manages BlobInventoryPolicy. + * + * @return Resource collection API of BlobInventoryPolicies. + */ + public BlobInventoryPolicies blobInventoryPolicies() { + if (this.blobInventoryPolicies == null) { + this.blobInventoryPolicies = new BlobInventoryPoliciesImpl(clientObject.getBlobInventoryPolicies(), this); + } + return blobInventoryPolicies; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of ObjectReplicationPoliciesOperations. It manages ObjectReplicationPolicy. + * + * @return Resource collection API of ObjectReplicationPoliciesOperations. + */ + public ObjectReplicationPoliciesOperations objectReplicationPoliciesOperations() { + if (this.objectReplicationPoliciesOperations == null) { + this.objectReplicationPoliciesOperations = + new ObjectReplicationPoliciesOperationsImpl( + clientObject.getObjectReplicationPoliciesOperations(), this); + } + return objectReplicationPoliciesOperations; + } + + /** + * Gets the resource collection API of LocalUsersOperations. It manages LocalUser. + * + * @return Resource collection API of LocalUsersOperations. + */ + public LocalUsersOperations localUsersOperations() { + if (this.localUsersOperations == null) { + this.localUsersOperations = new LocalUsersOperationsImpl(clientObject.getLocalUsersOperations(), this); + } + return localUsersOperations; + } + + /** + * Gets the resource collection API of EncryptionScopes. It manages EncryptionScope. + * + * @return Resource collection API of EncryptionScopes. + */ + public EncryptionScopes encryptionScopes() { + if (this.encryptionScopes == null) { + this.encryptionScopes = new EncryptionScopesImpl(clientObject.getEncryptionScopes(), this); + } + return encryptionScopes; + } + + /** + * Gets the resource collection API of BlobServices. It manages BlobServiceProperties. + * + * @return Resource collection API of BlobServices. + */ + public BlobServices blobServices() { + if (this.blobServices == null) { + this.blobServices = new BlobServicesImpl(clientObject.getBlobServices(), this); + } + return blobServices; + } + + /** + * Gets the resource collection API of BlobContainers. It manages BlobContainer, ImmutabilityPolicy. + * + * @return Resource collection API of BlobContainers. + */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(clientObject.getBlobContainers(), this); + } + return blobContainers; + } + + /** + * Gets the resource collection API of FileServices. It manages FileServiceProperties. + * + * @return Resource collection API of FileServices. + */ + public FileServices fileServices() { + if (this.fileServices == null) { + this.fileServices = new FileServicesImpl(clientObject.getFileServices(), this); + } + return fileServices; + } + + /** + * Gets the resource collection API of FileShares. It manages FileShare. + * + * @return Resource collection API of FileShares. + */ + public FileShares fileShares() { + if (this.fileShares == null) { + this.fileShares = new FileSharesImpl(clientObject.getFileShares(), this); + } + return fileShares; + } + + /** + * Gets the resource collection API of QueueServices. It manages QueueServiceProperties. + * + * @return Resource collection API of QueueServices. + */ + public QueueServices queueServices() { + if (this.queueServices == null) { + this.queueServices = new QueueServicesImpl(clientObject.getQueueServices(), this); + } + return queueServices; + } + + /** + * Gets the resource collection API of Queues. It manages StorageQueue. + * + * @return Resource collection API of Queues. + */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(clientObject.getQueues(), this); + } + return queues; + } + + /** + * Gets the resource collection API of TableServices. It manages TableServiceProperties. + * + * @return Resource collection API of TableServices. + */ + public TableServices tableServices() { + if (this.tableServices == null) { + this.tableServices = new TableServicesImpl(clientObject.getTableServices(), this); + } + return tableServices; + } + + /** + * Gets the resource collection API of Tables. It manages Table. + * + * @return Resource collection API of Tables. + */ + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); + } + return tables; + } + + /** + * @return Wrapped service client StorageManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public StorageManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java new file mode 100644 index 0000000000000..4aca40c9f0030 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java @@ -0,0 +1,694 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** An instance of this class provides access to all the operations defined in BlobContainersClient. */ +public interface BlobContainersClient { + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner create( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner update( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner get(String resourceGroupName, String accountName, String containerName); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String containerName, Context context); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LegalHoldInner setLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LegalHoldInner clearLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName); + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner deleteImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner lockImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner extendImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void objectLevelWorm(String resourceGroupName, String accountName, String containerName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java new file mode 100644 index 0000000000000..bad4d13151ed6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. */ +public interface BlobInventoryPoliciesClient { + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobInventoryPolicyInner get( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobInventoryPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties); + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties, + Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java new file mode 100644 index 0000000000000..488b0bd0b9012 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; + +/** An instance of this class provides access to all the operations defined in BlobServicesClient. */ +public interface BlobServicesClient { + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters); + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java new file mode 100644 index 0000000000000..61b5c447bae3a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; + +/** An instance of this class provides access to all the operations defined in DeletedAccountsClient. */ +public interface DeletedAccountsClient { + /** + * Lists deleted accounts under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists deleted accounts under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedAccountInner get(String deletedAccountName, String location); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deletedAccountName, String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java new file mode 100644 index 0000000000000..9858968743f6d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; + +/** An instance of this class provides access to all the operations defined in EncryptionScopesClient. */ +public interface EncryptionScopesClient { + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner put( + String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context); + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner patch( + String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope); + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context context); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java new file mode 100644 index 0000000000000..cdecfbcd2eb69 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; + +/** An instance of this class provides access to all the operations defined in FileServicesClient. */ +public interface FileServicesClient { + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServiceItemsInner list(String resourceGroupName, String accountName); + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters); + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java new file mode 100644 index 0000000000000..5bbaf29577b2b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** An instance of this class provides access to all the operations defined in FileSharesClient. */ +public interface FileSharesClient { + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner create(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String shareName, + FileShareInner fileShare, + String expand, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner get(String resourceGroupName, String accountName, String shareName); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + Context context); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String shareName); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LeaseShareResponseInner lease(String resourceGroupName, String accountName, String shareName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSharesLeaseResponse leaseWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters, + Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java new file mode 100644 index 0000000000000..a71af92163a4c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; + +/** An instance of this class provides access to all the operations defined in LocalUsersOperationsClient. */ +public interface LocalUsersOperationsClient { + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserInner get(String resourceGroupName, String accountName, String username); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String username, Context context); + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserInner createOrUpdate( + String resourceGroupName, String accountName, String username, LocalUserInner properties); + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String username, LocalUserInner properties, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String username); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserKeysInner listKeys(String resourceGroupName, String accountName, String username); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String accountName, String username, Context context); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserRegeneratePasswordResultInner regeneratePassword( + String resourceGroupName, String accountName, String username); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regeneratePasswordWithResponse( + String resourceGroupName, String accountName, String username, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java new file mode 100644 index 0000000000000..adb3a5fcfa885 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** An instance of this class provides access to all the operations defined in ManagementPoliciesClient. */ +public interface ManagementPoliciesClient { + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagementPolicyInner get(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagementPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties); + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties, + Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java new file mode 100644 index 0000000000000..97d13c2e7b977 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; + +/** + * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. + */ +public interface ObjectReplicationPoliciesOperationsClient { + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectReplicationPolicyInner get(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectReplicationPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties); + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties, + Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..c83d9d9bb5264 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..00eb3c837ad8a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner put( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..640bae31005fe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName); + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java new file mode 100644 index 0000000000000..8a5a428c15416 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; + +/** An instance of this class provides access to all the operations defined in QueueServicesClient. */ +public interface QueueServicesClient { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListQueueServicesInner list(String resourceGroupName, String accountName); + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QueueServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters); + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java new file mode 100644 index 0000000000000..27f9ec5034902 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public interface QueuesClient { + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner create(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner update(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner get(String resourceGroupName, String accountName, String queueName); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java new file mode 100644 index 0000000000000..3fdb3e97f97f1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java new file mode 100644 index 0000000000000..0809db5e2b88d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java @@ -0,0 +1,749 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public interface StorageAccountsClient { + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner create( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountListKeysResultInner regenerateKey( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListAccountSasResponseInner listAccountSas( + String resourceGroupName, String accountName, AccountSasParameters parameters); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListServiceSasResponseInner listServiceSas( + String resourceGroupName, String accountName, ServiceSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String accountName); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFailover(String resourceGroupName, String accountName, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failover(String resourceGroupName, String accountName); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void failover(String resourceGroupName, String accountName, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortHierarchicalNamespaceMigration( + String resourceGroupName, String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginAbortHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobRestoreStatusInner restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobRestoreStatusInner restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revokeUserDelegationKeys(String resourceGroupName, String accountName); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java new file mode 100644 index 0000000000000..8afa8cc6fd4a3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for StorageManagementClient class. */ +public interface StorageManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + StorageAccountsClient getStorageAccounts(); + + /** + * Gets the DeletedAccountsClient object to access its operations. + * + * @return the DeletedAccountsClient object. + */ + DeletedAccountsClient getDeletedAccounts(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the ManagementPoliciesClient object to access its operations. + * + * @return the ManagementPoliciesClient object. + */ + ManagementPoliciesClient getManagementPolicies(); + + /** + * Gets the BlobInventoryPoliciesClient object to access its operations. + * + * @return the BlobInventoryPoliciesClient object. + */ + BlobInventoryPoliciesClient getBlobInventoryPolicies(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. + * + * @return the ObjectReplicationPoliciesOperationsClient object. + */ + ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations(); + + /** + * Gets the LocalUsersOperationsClient object to access its operations. + * + * @return the LocalUsersOperationsClient object. + */ + LocalUsersOperationsClient getLocalUsersOperations(); + + /** + * Gets the EncryptionScopesClient object to access its operations. + * + * @return the EncryptionScopesClient object. + */ + EncryptionScopesClient getEncryptionScopes(); + + /** + * Gets the BlobServicesClient object to access its operations. + * + * @return the BlobServicesClient object. + */ + BlobServicesClient getBlobServices(); + + /** + * Gets the BlobContainersClient object to access its operations. + * + * @return the BlobContainersClient object. + */ + BlobContainersClient getBlobContainers(); + + /** + * Gets the FileServicesClient object to access its operations. + * + * @return the FileServicesClient object. + */ + FileServicesClient getFileServices(); + + /** + * Gets the FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + FileSharesClient getFileShares(); + + /** + * Gets the QueueServicesClient object to access its operations. + * + * @return the QueueServicesClient object. + */ + QueueServicesClient getQueueServices(); + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + QueuesClient getQueues(); + + /** + * Gets the TableServicesClient object to access its operations. + * + * @return the TableServicesClient object. + */ + TableServicesClient getTableServices(); + + /** + * Gets the TablesClient object to access its operations. + * + * @return the TablesClient object. + */ + TablesClient getTables(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java new file mode 100644 index 0000000000000..1678e50024ad1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; + +/** An instance of this class provides access to all the operations defined in TableServicesClient. */ +public interface TableServicesClient { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListTableServicesInner list(String resourceGroupName, String accountName); + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters); + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java new file mode 100644 index 0000000000000..6c6b3aa98d060 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; + +/** An instance of this class provides access to all the operations defined in TablesClient. */ +public interface TablesClient { + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner create(String resourceGroupName, String accountName, String tableName); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner update(String resourceGroupName, String accountName, String tableName); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner get(String resourceGroupName, String accountName, String tableName); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java new file mode 100644 index 0000000000000..fb78d134e3f4c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java new file mode 100644 index 0000000000000..e7878b4c45208 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Properties of the blob container, including Id, resource name, resource type, Etag. */ +@Fluent +public final class BlobContainerInner extends AzureEntityResource { + /* + * Properties of the blob container. + */ + @JsonProperty(value = "properties") + private ContainerProperties innerContainerProperties; + + /** + * Get the innerContainerProperties property: Properties of the blob container. + * + * @return the innerContainerProperties value. + */ + private ContainerProperties innerContainerProperties() { + return this.innerContainerProperties; + } + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deleted(); + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().remainingRetentionDays(); + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().defaultEncryptionScope(); + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDefaultEncryptionScope(String defaultEncryptionScope) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().denyEncryptionScopeOverride(); + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().publicAccess(); + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withPublicAccess(publicAccess); + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().lastModifiedTime(); + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseDuration(); + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withMetadata(Map metadata) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().immutabilityPolicy(); + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().legalHold(); + } + + /** + * Get the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasLegalHold(); + } + + /** + * Get the hasImmutabilityPolicy property: 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. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasImmutabilityPolicy(); + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().enableNfsV3RootSquash(); + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().enableNfsV3AllSquash(); + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerContainerProperties() != null) { + innerContainerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java new file mode 100644 index 0000000000000..f782cda5a4a2b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The storage account blob inventory policy. */ +@Fluent +public final class BlobInventoryPolicyInner extends ProxyResource { + /* + * Returns the storage account blob inventory policy rules. + */ + @JsonProperty(value = "properties") + private BlobInventoryPolicyProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Returns the storage account blob inventory policy rules. + * + * @return the innerProperties value. + */ + private BlobInventoryPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + public BlobInventoryPolicySchema policy() { + return this.innerProperties() == null ? null : this.innerProperties().policy(); + } + + /** + * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @param policy the policy value to set. + * @return the BlobInventoryPolicyInner object itself. + */ + public BlobInventoryPolicyInner withPolicy(BlobInventoryPolicySchema policy) { + if (this.innerProperties() == null) { + this.innerProperties = new BlobInventoryPolicyProperties(); + } + this.innerProperties().withPolicy(policy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java new file mode 100644 index 0000000000000..67f46a1b45265 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The storage account blob inventory policy properties. */ +@Fluent +public final class BlobInventoryPolicyProperties { + /* + * Returns the last modified date and time of the blob inventory policy. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The storage account blob inventory policy object. It is composed of policy rules. + */ + @JsonProperty(value = "policy", required = true) + private BlobInventoryPolicySchema policy; + + /** + * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + public BlobInventoryPolicySchema policy() { + return this.policy; + } + + /** + * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @param policy the policy value to set. + * @return the BlobInventoryPolicyProperties object itself. + */ + public BlobInventoryPolicyProperties withPolicy(BlobInventoryPolicySchema policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policy() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policy in model BlobInventoryPolicyProperties")); + } else { + policy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyProperties.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java new file mode 100644 index 0000000000000..736c0bb5dcc86 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreProgressStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob restore status. */ +@Immutable +public final class BlobRestoreStatusInner { + /* + * 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. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreProgressStatus status; + + /* + * Failure reason when blob restore is failed. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /* + * Id for tracking blob restore request. + */ + @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) + private String restoreId; + + /* + * Blob restore request parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreParameters parameters; + + /** + * Get the status property: 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. + * + * @return the status value. + */ + public BlobRestoreProgressStatus status() { + return this.status; + } + + /** + * Get the failureReason property: Failure reason when blob restore is failed. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get the restoreId property: Id for tracking blob restore request. + * + * @return the restoreId value. + */ + public String restoreId() { + return this.restoreId; + } + + /** + * Get the parameters property: Blob restore request parameters. + * + * @return the parameters value. + */ + public BlobRestoreParameters parameters() { + return this.parameters; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java new file mode 100644 index 0000000000000..853f0890e3ad5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Blob service. */ +@Fluent +public final class BlobServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Blob service. + */ + @JsonProperty(value = "properties") + private BlobServicePropertiesProperties innerBlobServiceProperties; + + /* + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /** + * Get the innerBlobServiceProperties property: The properties of a storage account’s Blob service. + * + * @return the innerBlobServiceProperties value. + */ + private BlobServicePropertiesProperties innerBlobServiceProperties() { + return this.innerBlobServiceProperties; + } + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().cors(); + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withCors(CorsRules cors) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withCors(cors); + return this; + } + + /** + * Get the defaultServiceVersion property: 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. + * + * @return the defaultServiceVersion value. + */ + public String defaultServiceVersion() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().defaultServiceVersion(); + } + + /** + * Set the defaultServiceVersion property: 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. + * + * @param defaultServiceVersion the defaultServiceVersion value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDefaultServiceVersion(String defaultServiceVersion) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + /** + * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().deleteRetentionPolicy(); + } + + /** + * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + + /** + * Get the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + public Boolean isVersioningEnabled() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().isVersioningEnabled(); + } + + /** + * Set the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @param isVersioningEnabled the isVersioningEnabled value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withIsVersioningEnabled(Boolean isVersioningEnabled) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withIsVersioningEnabled(isVersioningEnabled); + return this; + } + + /** + * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().automaticSnapshotPolicyEnabled(); + } + + /** + * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + return this; + } + + /** + * Get the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + public ChangeFeed changeFeed() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().changeFeed(); + } + + /** + * Set the changeFeed property: The blob service properties for change feed events. + * + * @param changeFeed the changeFeed value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withChangeFeed(changeFeed); + return this; + } + + /** + * Get the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + public RestorePolicyProperties restorePolicy() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().restorePolicy(); + } + + /** + * Set the restorePolicy property: The blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withRestorePolicy(restorePolicy); + return this; + } + + /** + * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().containerDeleteRetentionPolicy(); + } + + /** + * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withContainerDeleteRetentionPolicy( + DeleteRetentionPolicy containerDeleteRetentionPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); + return this; + } + + /** + * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().lastAccessTimeTrackingPolicy(); + } + + /** + * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withLastAccessTimeTrackingPolicy( + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withLastAccessTimeTrackingPolicy(lastAccessTimeTrackingPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerBlobServiceProperties() != null) { + innerBlobServiceProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java new file mode 100644 index 0000000000000..5f54766daafae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Blob service. */ +@Fluent +public final class BlobServicePropertiesProperties { + /* + * 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. + */ + @JsonProperty(value = "cors") + private CorsRules cors; + + /* + * 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. + */ + @JsonProperty(value = "defaultServiceVersion") + private String defaultServiceVersion; + + /* + * The blob service properties for blob soft delete. + */ + @JsonProperty(value = "deleteRetentionPolicy") + private DeleteRetentionPolicy deleteRetentionPolicy; + + /* + * Versioning is enabled if set to true. + */ + @JsonProperty(value = "isVersioningEnabled") + private Boolean isVersioningEnabled; + + /* + * Deprecated in favor of isVersioningEnabled property. + */ + @JsonProperty(value = "automaticSnapshotPolicyEnabled") + private Boolean automaticSnapshotPolicyEnabled; + + /* + * The blob service properties for change feed events. + */ + @JsonProperty(value = "changeFeed") + private ChangeFeed changeFeed; + + /* + * The blob service properties for blob restore policy. + */ + @JsonProperty(value = "restorePolicy") + private RestorePolicyProperties restorePolicy; + + /* + * The blob service properties for container soft delete. + */ + @JsonProperty(value = "containerDeleteRetentionPolicy") + private DeleteRetentionPolicy containerDeleteRetentionPolicy; + + /* + * The blob service property to configure last access time based tracking policy. + */ + @JsonProperty(value = "lastAccessTimeTrackingPolicy") + private LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy; + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get the defaultServiceVersion property: 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. + * + * @return the defaultServiceVersion value. + */ + public String defaultServiceVersion() { + return this.defaultServiceVersion; + } + + /** + * Set the defaultServiceVersion property: 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. + * + * @param defaultServiceVersion the defaultServiceVersion value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withDefaultServiceVersion(String defaultServiceVersion) { + this.defaultServiceVersion = defaultServiceVersion; + return this; + } + + /** + * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.deleteRetentionPolicy; + } + + /** + * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.deleteRetentionPolicy = deleteRetentionPolicy; + return this; + } + + /** + * Get the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + public Boolean isVersioningEnabled() { + return this.isVersioningEnabled; + } + + /** + * Set the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @param isVersioningEnabled the isVersioningEnabled value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.isVersioningEnabled = isVersioningEnabled; + return this; + } + + /** + * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.automaticSnapshotPolicyEnabled; + } + + /** + * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.automaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled; + return this; + } + + /** + * Get the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + public ChangeFeed changeFeed() { + return this.changeFeed; + } + + /** + * Set the changeFeed property: The blob service properties for change feed events. + * + * @param changeFeed the changeFeed value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withChangeFeed(ChangeFeed changeFeed) { + this.changeFeed = changeFeed; + return this; + } + + /** + * Get the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + public RestorePolicyProperties restorePolicy() { + return this.restorePolicy; + } + + /** + * Set the restorePolicy property: The blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.restorePolicy = restorePolicy; + return this; + } + + /** + * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.containerDeleteRetentionPolicy; + } + + /** + * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withContainerDeleteRetentionPolicy( + DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.containerDeleteRetentionPolicy = containerDeleteRetentionPolicy; + return this; + } + + /** + * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.lastAccessTimeTrackingPolicy; + } + + /** + * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withLastAccessTimeTrackingPolicy( + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + this.lastAccessTimeTrackingPolicy = lastAccessTimeTrackingPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + if (deleteRetentionPolicy() != null) { + deleteRetentionPolicy().validate(); + } + if (changeFeed() != null) { + changeFeed().validate(); + } + if (restorePolicy() != null) { + restorePolicy().validate(); + } + if (containerDeleteRetentionPolicy() != null) { + containerDeleteRetentionPolicy().validate(); + } + if (lastAccessTimeTrackingPolicy() != null) { + lastAccessTimeTrackingPolicy().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..a53ab329e437e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.models.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + /* + * 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. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * Gets the reason that a storage account name could not be used. The Reason element is only returned if + * NameAvailable is false. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /* + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailable property: 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. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: Gets the reason that a storage account name could not be used. The Reason element is + * only returned if NameAvailable is false. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Get the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java new file mode 100644 index 0000000000000..85e7b7f7d7184 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** The properties of a container. */ +@Fluent +public final class ContainerProperties { + /* + * The version of the deleted blob container. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * Blob container deletion time. + */ + @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Default the container to use specified encryption scope for all writes. + */ + @JsonProperty(value = "defaultEncryptionScope") + private String defaultEncryptionScope; + + /* + * Block override of encryption scope from the container default. + */ + @JsonProperty(value = "denyEncryptionScopeOverride") + private Boolean denyEncryptionScopeOverride; + + /* + * Specifies whether data in the container may be accessed publicly and the level of access. + */ + @JsonProperty(value = "publicAccess") + private PublicAccess publicAccess; + + /* + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The lease status of the container. + */ + @JsonProperty(value = "leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the container. + */ + @JsonProperty(value = "leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + */ + @JsonProperty(value = "leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /* + * The LegalHold property of the container. + */ + @JsonProperty(value = "legalHold", access = JsonProperty.Access.WRITE_ONLY) + private LegalHoldProperties legalHold; + + /* + * 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. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /* + * 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. + */ + @JsonProperty(value = "hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasImmutabilityPolicy; + + /* + * 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. + */ + @JsonProperty(value = "immutableStorageWithVersioning") + private ImmutableStorageWithVersioning immutableStorageWithVersioning; + + /* + * Enable NFSv3 root squash on blob container. + */ + @JsonProperty(value = "enableNfsV3RootSquash") + private Boolean enableNfsV3RootSquash; + + /* + * Enable NFSv3 all squash on blob container. + */ + @JsonProperty(value = "enableNfsV3AllSquash") + private Boolean enableNfsV3AllSquash; + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.defaultEncryptionScope; + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withDefaultEncryptionScope(String defaultEncryptionScope) { + this.defaultEncryptionScope = defaultEncryptionScope; + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.denyEncryptionScopeOverride; + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy property: 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. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.enableNfsV3RootSquash; + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + this.enableNfsV3RootSquash = enableNfsV3RootSquash; + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.enableNfsV3AllSquash; + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + this.enableNfsV3AllSquash = enableNfsV3AllSquash; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + if (legalHold() != null) { + legalHold().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java new file mode 100644 index 0000000000000..785ee1158f630 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted storage account. */ +@Fluent +public final class DeletedAccountInner extends ProxyResource { + /* + * Properties of the deleted account. + */ + @JsonProperty(value = "properties") + private DeletedAccountProperties innerProperties; + + /** + * Get the innerProperties property: Properties of the deleted account. + * + * @return the innerProperties value. + */ + private DeletedAccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountResourceId(); + } + + /** + * Get the location property: Location of the deleted account. + * + * @return the location value. + */ + public String location() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + public String restoreReference() { + return this.innerProperties() == null ? null : this.innerProperties().restoreReference(); + } + + /** + * Get the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + public String creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + public String deletionTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletionTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java new file mode 100644 index 0000000000000..6c91050307d95 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Attributes of a deleted storage account. */ +@Immutable +public final class DeletedAccountProperties { + /* + * Full resource id of the original storage account. + */ + @JsonProperty(value = "storageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountResourceId; + + /* + * Location of the deleted account. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Can be used to attempt recovering this deleted account via PutStorageAccount API. + */ + @JsonProperty(value = "restoreReference", access = JsonProperty.Access.WRITE_ONLY) + private String restoreReference; + + /* + * Creation time of the deleted account. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /* + * Deletion time of the deleted account. + */ + @JsonProperty(value = "deletionTime", access = JsonProperty.Access.WRITE_ONLY) + private String deletionTime; + + /** + * Get the storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Get the location property: Location of the deleted account. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + public String restoreReference() { + return this.restoreReference; + } + + /** + * Get the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + public String deletionTime() { + return this.deletionTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java new file mode 100644 index 0000000000000..da83029c070f9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Encryption Scope resource. */ +@Fluent +public final class EncryptionScopeInner extends ProxyResource { + /* + * Properties of the encryption scope. + */ + @JsonProperty(value = "properties") + private EncryptionScopeProperties innerEncryptionScopeProperties; + + /** + * Get the innerEncryptionScopeProperties property: Properties of the encryption scope. + * + * @return the innerEncryptionScopeProperties value. + */ + private EncryptionScopeProperties innerEncryptionScopeProperties() { + return this.innerEncryptionScopeProperties; + } + + /** + * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + public EncryptionScopeSource source() { + return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().source(); + } + + /** + * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @param source the source value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withSource(EncryptionScopeSource source) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withSource(source); + return this; + } + + /** + * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @return the state value. + */ + public EncryptionScopeState state() { + return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().state(); + } + + /** + * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @param state the state value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withState(EncryptionScopeState state) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withState(state); + return this; + } + + /** + * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().creationTime(); + } + + /** + * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().lastModifiedTime(); + } + + /** + * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().keyVaultProperties(); + } + + /** + * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withKeyVaultProperties(keyVaultProperties); + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().requireInfrastructureEncryption(); + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withRequireInfrastructureEncryption(requireInfrastructureEncryption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerEncryptionScopeProperties() != null) { + innerEncryptionScopeProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java new file mode 100644 index 0000000000000..fa4c33e7b301e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of the encryption scope. */ +@Fluent +public final class EncryptionScopeProperties { + /* + * The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, + * Microsoft.KeyVault. + */ + @JsonProperty(value = "source") + private EncryptionScopeSource source; + + /* + * The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + */ + @JsonProperty(value = "state") + private EncryptionScopeState state; + + /* + * Gets the creation date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets the last modification date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' + * attribute is set to 'Microsoft.KeyVault'. + */ + @JsonProperty(value = "keyVaultProperties") + private EncryptionScopeKeyVaultProperties keyVaultProperties; + + /* + * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed + * keys for data at rest. + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /** + * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + public EncryptionScopeSource source() { + return this.source; + } + + /** + * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @param source the source value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withSource(EncryptionScopeSource source) { + this.source = source; + return this; + } + + /** + * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @return the state value. + */ + public EncryptionScopeState state() { + return this.state; + } + + /** + * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @param state the state value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withState(EncryptionScopeState state) { + this.state = state; + return this; + } + + /** + * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java new file mode 100644 index 0000000000000..156f10efab0fc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The FileServiceItems model. */ +@Immutable +public final class FileServiceItemsInner { + /* + * List of file services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: List of file services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java new file mode 100644 index 0000000000000..7c89237454c87 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of File services in storage account. */ +@Fluent +public final class FileServicePropertiesInner extends ProxyResource { + /* + * The properties of File services in storage account. + */ + @JsonProperty(value = "properties") + private FileServicePropertiesProperties innerFileServiceProperties; + + /* + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /** + * Get the innerFileServiceProperties property: The properties of File services in storage account. + * + * @return the innerFileServiceProperties value. + */ + private FileServicePropertiesProperties innerFileServiceProperties() { + return this.innerFileServiceProperties; + } + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerFileServiceProperties() == null ? null : this.innerFileServiceProperties().cors(); + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withCors(CorsRules cors) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withCors(cors); + return this; + } + + /** + * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.innerFileServiceProperties() == null + ? null + : this.innerFileServiceProperties().shareDeleteRetentionPolicy(); + } + + /** + * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); + return this; + } + + /** + * Get the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + public ProtocolSettings protocolSettings() { + return this.innerFileServiceProperties() == null ? null : this.innerFileServiceProperties().protocolSettings(); + } + + /** + * Set the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings the protocolSettings value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withProtocolSettings(ProtocolSettings protocolSettings) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withProtocolSettings(protocolSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerFileServiceProperties() != null) { + innerFileServiceProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java new file mode 100644 index 0000000000000..754bae7bd821b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of File services in storage account. */ +@Fluent +public final class FileServicePropertiesProperties { + /* + * 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. + */ + @JsonProperty(value = "cors") + private CorsRules cors; + + /* + * The file service properties for share soft delete. + */ + @JsonProperty(value = "shareDeleteRetentionPolicy") + private DeleteRetentionPolicy shareDeleteRetentionPolicy; + + /* + * Protocol settings for file service + */ + @JsonProperty(value = "protocolSettings") + private ProtocolSettings protocolSettings; + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.shareDeleteRetentionPolicy; + } + + /** + * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties withShareDeleteRetentionPolicy( + DeleteRetentionPolicy shareDeleteRetentionPolicy) { + this.shareDeleteRetentionPolicy = shareDeleteRetentionPolicy; + return this; + } + + /** + * Get the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + public ProtocolSettings protocolSettings() { + return this.protocolSettings; + } + + /** + * Set the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings the protocolSettings value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties withProtocolSettings(ProtocolSettings protocolSettings) { + this.protocolSettings = protocolSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + if (shareDeleteRetentionPolicy() != null) { + shareDeleteRetentionPolicy().validate(); + } + if (protocolSettings() != null) { + protocolSettings().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java new file mode 100644 index 0000000000000..1c155eed46fab --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of the file share, including Id, resource name, resource type, Etag. */ +@Fluent +public final class FileShareInner extends AzureEntityResource { + /* + * Properties of the file share. + */ + @JsonProperty(value = "properties") + private FileShareProperties innerFileShareProperties; + + /** + * Get the innerFileShareProperties property: Properties of the file share. + * + * @return the innerFileShareProperties value. + */ + private FileShareProperties innerFileShareProperties() { + return this.innerFileShareProperties; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().lastModifiedTime(); + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withMetadata(Map metadata) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withMetadata(metadata); + return this; + } + + /** + * Get the shareQuota property: 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. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareQuota(); + } + + /** + * Set the shareQuota property: 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. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withShareQuota(Integer shareQuota) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withShareQuota(shareQuota); + return this; + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().enabledProtocols(); + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withEnabledProtocols(enabledProtocols); + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().rootSquash(); + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withRootSquash(RootSquashType rootSquash) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withRootSquash(rootSquash); + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deleted(); + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().remainingRetentionDays(); + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTier(); + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withAccessTier(ShareAccessTier accessTier) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierChangeTime(); + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierStatus(); + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareUsageBytes(); + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseDuration(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().snapshotTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerFileShareProperties() != null) { + innerFileShareProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java new file mode 100644 index 0000000000000..01852779cf879 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The file share properties be listed out. */ +@Fluent +public final class FileShareItemInner extends AzureEntityResource { + /* + * The file share properties be listed out. + */ + @JsonProperty(value = "properties") + private FileShareProperties innerProperties; + + /** + * Get the innerProperties property: The file share properties be listed out. + * + * @return the innerProperties value. + */ + private FileShareProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the shareQuota property: 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. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.innerProperties() == null ? null : this.innerProperties().shareQuota(); + } + + /** + * Set the shareQuota property: 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. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withShareQuota(Integer shareQuota) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withShareQuota(shareQuota); + return this; + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().enabledProtocols(); + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withEnabledProtocols(enabledProtocols); + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.innerProperties() == null ? null : this.innerProperties().rootSquash(); + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withRootSquash(RootSquashType rootSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withRootSquash(rootSquash); + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerProperties() == null ? null : this.innerProperties().deleted(); + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withAccessTier(ShareAccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.innerProperties() == null ? null : this.innerProperties().accessTierChangeTime(); + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.innerProperties() == null ? null : this.innerProperties().accessTierStatus(); + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.innerProperties() == null ? null : this.innerProperties().shareUsageBytes(); + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerProperties() == null ? null : this.innerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerProperties() == null ? null : this.innerProperties().leaseDuration(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerProperties() == null ? null : this.innerProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.innerProperties() == null ? null : this.innerProperties().snapshotTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java new file mode 100644 index 0000000000000..f495f68c14336 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The properties of the file share. */ +@Fluent +public final class FileShareProperties { + /* + * Returns the date and time the share was last modified. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * A name-value pair to associate with the share as metadata. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * 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. + */ + @JsonProperty(value = "shareQuota") + private Integer shareQuota; + + /* + * The authentication protocol that is used for the file share. Can only be specified when creating a share. + */ + @JsonProperty(value = "enabledProtocols") + private EnabledProtocols enabledProtocols; + + /* + * The property is for NFS share only. The default is NoRootSquash. + */ + @JsonProperty(value = "rootSquash") + private RootSquashType rootSquash; + + /* + * The version of the share. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + * FileStorage account can choose Premium. + */ + @JsonProperty(value = "accessTier") + private ShareAccessTier accessTier; + + /* + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessTierChangeTime; + + /* + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + private String accessTierStatus; + + /* + * The approximate size of the data stored on the share. Note that this value may not include all recently created + * or recently resized files. + */ + @JsonProperty(value = "shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long shareUsageBytes; + + /* + * The lease status of the share. + */ + @JsonProperty(value = "leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the share. + */ + @JsonProperty(value = "leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + */ + @JsonProperty(value = "leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * List of stored access policies specified on the share. + */ + @JsonProperty(value = "signedIdentifiers") + private List signedIdentifiers; + + /* + * Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + */ + @JsonProperty(value = "snapshotTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime snapshotTime; + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the shareQuota property: 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. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the shareQuota property: 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. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.shareUsageBytes; + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.signedIdentifiers; + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withSignedIdentifiers(List signedIdentifiers) { + this.signedIdentifiers = signedIdentifiers; + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.snapshotTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java new file mode 100644 index 0000000000000..377abb1a6789d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. */ +@Fluent +public final class ImmutabilityPolicyInner extends AzureEntityResource { + /* + * The properties of an ImmutabilityPolicy of a blob container. + */ + @JsonProperty(value = "properties", required = true) + private ImmutabilityPolicyProperty innerProperties = new ImmutabilityPolicyProperty(); + + /** + * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. + * + * @return the innerProperties value. + */ + private ImmutabilityPolicyProperty innerProperties() { + return this.innerProperties; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withImmutabilityPeriodSinceCreationInDays( + Integer immutabilityPeriodSinceCreationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); + } + + /** + * Set the allowProtectedAppendWrites property: 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. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWritesAll(); + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ImmutabilityPolicyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImmutabilityPolicyInner.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java new file mode 100644 index 0000000000000..95338835a9bfb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an ImmutabilityPolicy of a blob container. */ +@Fluent +public final class ImmutabilityPolicyProperty { + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays") + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyState state; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWritesAll") + private Boolean allowProtectedAppendWritesAll; + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty withImmutabilityPeriodSinceCreationInDays( + Integer immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.state; + } + + /** + * Get the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: 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. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java new file mode 100644 index 0000000000000..5b37c775d5941 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Container response schema. */ +@Fluent +public final class LeaseContainerResponseInner { + /* + * Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or + * release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set. + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set. + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java new file mode 100644 index 0000000000000..d5388529397d7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Share response schema. */ +@Fluent +public final class LeaseShareResponseInner { + /* + * Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or + * release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * Get the leaseId property: Returned unique lease ID that must be included with any request to delete the share, or + * to renew, change, or release the lease. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Returned unique lease ID that must be included with any request to delete the share, or + * to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set. + * @return the LeaseShareResponseInner object itself. + */ + public LeaseShareResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set. + * @return the LeaseShareResponseInner object itself. + */ + public LeaseShareResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java new file mode 100644 index 0000000000000..7ba308f2bbe7d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LegalHold property of a blob container. */ +@Fluent +public final class LegalHoldInner { + /* + * 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. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /* + * Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + */ + @JsonProperty(value = "tags", required = true) + private List tags; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWritesAll") + private Boolean allowProtectedAppendWritesAll; + + /** + * Get the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @param tags the tags value to set. + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tags in model LegalHoldInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LegalHoldInner.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java new file mode 100644 index 0000000000000..36294922397ae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The List SAS credentials operation response. */ +@Immutable +public final class ListAccountSasResponseInner { + /* + * List SAS credentials of storage account. + */ + @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String accountSasToken; + + /** + * Get the accountSasToken property: List SAS credentials of storage account. + * + * @return the accountSasToken value. + */ + public String accountSasToken() { + return this.accountSasToken; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java new file mode 100644 index 0000000000000..21c42cf09d4f9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** The blob container properties be listed out. */ +@Fluent +public final class ListContainerItemInner extends AzureEntityResource { + /* + * The blob container properties be listed out. + */ + @JsonProperty(value = "properties") + private ContainerProperties innerProperties; + + /** + * Get the innerProperties property: The blob container properties be listed out. + * + * @return the innerProperties value. + */ + private ContainerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerProperties() == null ? null : this.innerProperties().deleted(); + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.innerProperties() == null ? null : this.innerProperties().defaultEncryptionScope(); + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDefaultEncryptionScope(String defaultEncryptionScope) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.innerProperties() == null ? null : this.innerProperties().denyEncryptionScopeOverride(); + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicAccess(); + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withPublicAccess(PublicAccess publicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withPublicAccess(publicAccess); + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerProperties() == null ? null : this.innerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerProperties() == null ? null : this.innerProperties().leaseDuration(); + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPolicy(); + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.innerProperties() == null ? null : this.innerProperties().legalHold(); + } + + /** + * Get the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.innerProperties() == null ? null : this.innerProperties().hasLegalHold(); + } + + /** + * Get the hasImmutabilityPolicy property: 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. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().hasImmutabilityPolicy(); + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3RootSquash(); + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3AllSquash(); + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java new file mode 100644 index 0000000000000..dfcfdf2c878d4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The ListQueue model. */ +@Fluent +public final class ListQueueInner extends ProxyResource { + /* + * List Queue resource properties. + */ + @JsonProperty(value = "properties") + private ListQueueProperties innerQueueProperties; + + /** + * Get the innerQueueProperties property: List Queue resource properties. + * + * @return the innerQueueProperties value. + */ + private ListQueueProperties innerQueueProperties() { + return this.innerQueueProperties; + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the ListQueueInner object itself. + */ + public ListQueueInner withMetadata(Map metadata) { + if (this.innerQueueProperties() == null) { + this.innerQueueProperties = new ListQueueProperties(); + } + this.innerQueueProperties().withMetadata(metadata); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueProperties() != null) { + innerQueueProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java new file mode 100644 index 0000000000000..42cee2323c5b4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The ListQueueProperties model. */ +@Fluent +public final class ListQueueProperties { + /* + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the ListQueueProperties object itself. + */ + public ListQueueProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java new file mode 100644 index 0000000000000..8be7e8826217b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ListQueueServices model. */ +@Immutable +public final class ListQueueServicesInner { + /* + * List of queue services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: List of queue services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java new file mode 100644 index 0000000000000..21d4262b73527 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The List service SAS credentials operation response. */ +@Immutable +public final class ListServiceSasResponseInner { + /* + * List service SAS credentials of specific resource. + */ + @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceSasToken; + + /** + * Get the serviceSasToken property: List service SAS credentials of specific resource. + * + * @return the serviceSasToken value. + */ + public String serviceSasToken() { + return this.serviceSasToken; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java new file mode 100644 index 0000000000000..a888c037363e2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ListTableServices model. */ +@Immutable +public final class ListTableServicesInner { + /* + * List of table services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: List of table services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java new file mode 100644 index 0000000000000..0eac9da489d00 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The local user associated with the storage accounts. */ +@Fluent +public final class LocalUserInner extends ProxyResource { + /* + * Storage account local user properties. + */ + @JsonProperty(value = "properties") + private LocalUserProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Storage account local user properties. + * + * @return the innerProperties value. + */ + private LocalUserProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + public List permissionScopes() { + return this.innerProperties() == null ? null : this.innerProperties().permissionScopes(); + } + + /** + * Set the permissionScopes property: The permission scopes of the local user. + * + * @param permissionScopes the permissionScopes value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withPermissionScopes(List permissionScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withPermissionScopes(permissionScopes); + return this; + } + + /** + * Get the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + public String homeDirectory() { + return this.innerProperties() == null ? null : this.innerProperties().homeDirectory(); + } + + /** + * Set the homeDirectory property: Optional, local user home directory. + * + * @param homeDirectory the homeDirectory value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHomeDirectory(String homeDirectory) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHomeDirectory(homeDirectory); + return this; + } + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.innerProperties() == null ? null : this.innerProperties().sshAuthorizedKeys(); + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withSshAuthorizedKeys(List sshAuthorizedKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withSshAuthorizedKeys(sshAuthorizedKeys); + return this; + } + + /** + * Get the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + public String sid() { + return this.innerProperties() == null ? null : this.innerProperties().sid(); + } + + /** + * Get the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + public Boolean hasSharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().hasSharedKey(); + } + + /** + * Set the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @param hasSharedKey the hasSharedKey value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSharedKey(Boolean hasSharedKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSharedKey(hasSharedKey); + return this; + } + + /** + * Get the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + public Boolean hasSshKey() { + return this.innerProperties() == null ? null : this.innerProperties().hasSshKey(); + } + + /** + * Set the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @param hasSshKey the hasSshKey value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSshKey(Boolean hasSshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSshKey(hasSshKey); + return this; + } + + /** + * Get the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + public Boolean hasSshPassword() { + return this.innerProperties() == null ? null : this.innerProperties().hasSshPassword(); + } + + /** + * Set the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @param hasSshPassword the hasSshPassword value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSshPassword(Boolean hasSshPassword) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSshPassword(hasSshPassword); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java new file mode 100644 index 0000000000000..58e56776ddda7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Storage Account Local User keys. */ +@Fluent +public final class LocalUserKeysInner { + /* + * Optional, local user ssh authorized keys for SFTP. + */ + @JsonProperty(value = "sshAuthorizedKeys") + private List sshAuthorizedKeys; + + /* + * Auto generated by the server for SMB authentication. + */ + @JsonProperty(value = "sharedKey", access = JsonProperty.Access.WRITE_ONLY) + private String sharedKey; + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.sshAuthorizedKeys; + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserKeysInner object itself. + */ + public LocalUserKeysInner withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.sshAuthorizedKeys = sshAuthorizedKeys; + return this; + } + + /** + * Get the sharedKey property: Auto generated by the server for SMB authentication. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshAuthorizedKeys() != null) { + sshAuthorizedKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java new file mode 100644 index 0000000000000..687c09ed24dad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Storage Account Local User properties. */ +@Fluent +public final class LocalUserProperties { + /* + * The permission scopes of the local user. + */ + @JsonProperty(value = "permissionScopes") + private List permissionScopes; + + /* + * Optional, local user home directory. + */ + @JsonProperty(value = "homeDirectory") + private String homeDirectory; + + /* + * Optional, local user ssh authorized keys for SFTP. + */ + @JsonProperty(value = "sshAuthorizedKeys") + private List sshAuthorizedKeys; + + /* + * A unique Security Identifier that is generated by the server. + */ + @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) + private String sid; + + /* + * Indicates whether shared key exists. Set it to false to remove existing shared key. + */ + @JsonProperty(value = "hasSharedKey") + private Boolean hasSharedKey; + + /* + * Indicates whether ssh key exists. Set it to false to remove existing SSH key. + */ + @JsonProperty(value = "hasSshKey") + private Boolean hasSshKey; + + /* + * Indicates whether ssh password exists. Set it to false to remove existing SSH password. + */ + @JsonProperty(value = "hasSshPassword") + private Boolean hasSshPassword; + + /** + * Get the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + public List permissionScopes() { + return this.permissionScopes; + } + + /** + * Set the permissionScopes property: The permission scopes of the local user. + * + * @param permissionScopes the permissionScopes value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withPermissionScopes(List permissionScopes) { + this.permissionScopes = permissionScopes; + return this; + } + + /** + * Get the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + public String homeDirectory() { + return this.homeDirectory; + } + + /** + * Set the homeDirectory property: Optional, local user home directory. + * + * @param homeDirectory the homeDirectory value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHomeDirectory(String homeDirectory) { + this.homeDirectory = homeDirectory; + return this; + } + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.sshAuthorizedKeys; + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.sshAuthorizedKeys = sshAuthorizedKeys; + return this; + } + + /** + * Get the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Get the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + public Boolean hasSharedKey() { + return this.hasSharedKey; + } + + /** + * Set the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @param hasSharedKey the hasSharedKey value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSharedKey(Boolean hasSharedKey) { + this.hasSharedKey = hasSharedKey; + return this; + } + + /** + * Get the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + public Boolean hasSshKey() { + return this.hasSshKey; + } + + /** + * Set the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @param hasSshKey the hasSshKey value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSshKey(Boolean hasSshKey) { + this.hasSshKey = hasSshKey; + return this; + } + + /** + * Get the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + public Boolean hasSshPassword() { + return this.hasSshPassword; + } + + /** + * Set the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @param hasSshPassword the hasSshPassword value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSshPassword(Boolean hasSshPassword) { + this.hasSshPassword = hasSshPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissionScopes() != null) { + permissionScopes().forEach(e -> e.validate()); + } + if (sshAuthorizedKeys() != null) { + sshAuthorizedKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java new file mode 100644 index 0000000000000..688615163254e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The secrets of Storage Account Local User. */ +@Immutable +public final class LocalUserRegeneratePasswordResultInner { + /* + * Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of + * local user. + */ + @JsonProperty(value = "sshPassword", access = JsonProperty.Access.WRITE_ONLY) + private String sshPassword; + + /** + * Get the sshPassword property: Auto generated password by the server for SSH authentication if hasSshPassword is + * set to true on the creation of local user. + * + * @return the sshPassword value. + */ + public String sshPassword() { + return this.sshPassword; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java new file mode 100644 index 0000000000000..7f5111c97532f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Get Storage Account ManagementPolicies operation response. */ +@Fluent +public final class ManagementPolicyInner extends ProxyResource { + /* + * Returns the Storage Account Data Policies Rules. + */ + @JsonProperty(value = "properties") + private ManagementPolicyProperties innerProperties; + + /** + * Get the innerProperties property: Returns the Storage Account Data Policies Rules. + * + * @return the innerProperties value. + */ + private ManagementPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + public ManagementPolicySchema policy() { + return this.innerProperties() == null ? null : this.innerProperties().policy(); + } + + /** + * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set. + * @return the ManagementPolicyInner object itself. + */ + public ManagementPolicyInner withPolicy(ManagementPolicySchema policy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagementPolicyProperties(); + } + this.innerProperties().withPolicy(policy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java new file mode 100644 index 0000000000000..f7c9edf0b226f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Storage Account ManagementPolicy properties. */ +@Fluent +public final class ManagementPolicyProperties { + /* + * Returns the date and time the ManagementPolicies was last modified. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "policy", required = true) + private ManagementPolicySchema policy; + + /** + * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + public ManagementPolicySchema policy() { + return this.policy; + } + + /** + * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set. + * @return the ManagementPolicyProperties object itself. + */ + public ManagementPolicyProperties withPolicy(ManagementPolicySchema policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policy() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property policy in model ManagementPolicyProperties")); + } else { + policy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyProperties.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java new file mode 100644 index 0000000000000..fcef72f629e9b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The replication policy between two storage accounts. Multiple rules can be defined in one policy. */ +@Fluent +public final class ObjectReplicationPolicyInner extends ProxyResource { + /* + * Returns the Storage Account Object Replication Policy. + */ + @JsonProperty(value = "properties") + private ObjectReplicationPolicyProperties innerProperties; + + /** + * Get the innerProperties property: Returns the Storage Account Object Replication Policy. + * + * @return the innerProperties value. + */ + private ObjectReplicationPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + public String policyId() { + return this.innerProperties() == null ? null : this.innerProperties().policyId(); + } + + /** + * Get the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + public OffsetDateTime enabledTime() { + return this.innerProperties() == null ? null : this.innerProperties().enabledTime(); + } + + /** + * Get the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + public String sourceAccount() { + return this.innerProperties() == null ? null : this.innerProperties().sourceAccount(); + } + + /** + * Set the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param sourceAccount the sourceAccount value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withSourceAccount(String sourceAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withSourceAccount(sourceAccount); + return this; + } + + /** + * Get the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + public String destinationAccount() { + return this.innerProperties() == null ? null : this.innerProperties().destinationAccount(); + } + + /** + * Set the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param destinationAccount the destinationAccount value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withDestinationAccount(String destinationAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withDestinationAccount(destinationAccount); + return this; + } + + /** + * Get the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().rules(); + } + + /** + * Set the rules property: The storage account object replication rules. + * + * @param rules the rules value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withRules(List rules) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withRules(rules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java new file mode 100644 index 0000000000000..f6382cef876f1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The Storage Account ObjectReplicationPolicy properties. */ +@Fluent +public final class ObjectReplicationPolicyProperties { + /* + * A unique id for object replication policy. + */ + @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) + private String policyId; + + /* + * Indicates when the policy is enabled on the source account. + */ + @JsonProperty(value = "enabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime enabledTime; + + /* + * Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + */ + @JsonProperty(value = "sourceAccount", required = true) + private String sourceAccount; + + /* + * Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + */ + @JsonProperty(value = "destinationAccount", required = true) + private String destinationAccount; + + /* + * The storage account object replication rules. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Get the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + public OffsetDateTime enabledTime() { + return this.enabledTime; + } + + /** + * Get the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + public String sourceAccount() { + return this.sourceAccount; + } + + /** + * Set the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param sourceAccount the sourceAccount value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withSourceAccount(String sourceAccount) { + this.sourceAccount = sourceAccount; + return this; + } + + /** + * Get the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + public String destinationAccount() { + return this.destinationAccount; + } + + /** + * Set the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param destinationAccount the destinationAccount value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withDestinationAccount(String destinationAccount) { + this.destinationAccount = destinationAccount; + return this; + } + + /** + * Get the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The storage account object replication rules. + * + * @param rules the rules value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceAccount() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceAccount in model ObjectReplicationPolicyProperties")); + } + if (destinationAccount() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationAccount in model ObjectReplicationPolicyProperties")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyProperties.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..50b5c51f2d0d0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.OperationDisplay; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage REST API operation definition. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of operation, include metric specifications. + */ + @JsonProperty(value = "properties") + private OperationProperties innerOperationProperties; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display metadata associated with the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin of operations. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the innerOperationProperties property: Properties of operation, include metric specifications. + * + * @return the innerOperationProperties value. + */ + private OperationProperties innerOperationProperties() { + return this.innerOperationProperties; + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + if (this.innerOperationProperties() == null) { + this.innerOperationProperties = new OperationProperties(); + } + this.innerOperationProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerOperationProperties() != null) { + innerOperationProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java new file mode 100644 index 0000000000000..2e6118de017d7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of operation, include metric specifications. */ +@Fluent +public final class OperationProperties { + /* + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..3076878ff6a6c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..d6735e0e927e1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..4f61dd8236c20 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..bca44d6247f83 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java new file mode 100644 index 0000000000000..562492af1c82c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The QueueProperties model. */ +@Fluent +public final class QueueProperties { + /* + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * 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. + */ + @JsonProperty(value = "approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer approximateMessageCount; + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the QueueProperties object itself. + */ + public QueueProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the approximateMessageCount property: 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. + * + * @return the approximateMessageCount value. + */ + public Integer approximateMessageCount() { + return this.approximateMessageCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java new file mode 100644 index 0000000000000..9ae89e023b12c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Queue service. */ +@Fluent +public final class QueueServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Queue service. + */ + @JsonProperty(value = "properties") + private QueueServicePropertiesProperties innerQueueServiceProperties; + + /** + * Get the innerQueueServiceProperties property: The properties of a storage account’s Queue service. + * + * @return the innerQueueServiceProperties value. + */ + private QueueServicePropertiesProperties innerQueueServiceProperties() { + return this.innerQueueServiceProperties; + } + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerQueueServiceProperties() == null ? null : this.innerQueueServiceProperties().cors(); + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the QueueServicePropertiesInner object itself. + */ + public QueueServicePropertiesInner withCors(CorsRules cors) { + if (this.innerQueueServiceProperties() == null) { + this.innerQueueServiceProperties = new QueueServicePropertiesProperties(); + } + this.innerQueueServiceProperties().withCors(cors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueServiceProperties() != null) { + innerQueueServiceProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java new file mode 100644 index 0000000000000..663a678a941f6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Queue service. */ +@Fluent +public final class QueueServicePropertiesProperties { + /* + * 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. + */ + @JsonProperty(value = "cors") + private CorsRules cors; + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the QueueServicePropertiesProperties object itself. + */ + public QueueServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java new file mode 100644 index 0000000000000..0721a646c2212 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.Restriction; +import com.azure.resourcemanager.storage.generated.models.SkuCapability; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.SkuTier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Storage SKU and its properties. */ +@Fluent +public final class SkuInformationInner { + /* + * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was + * called accountType. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /* + * The type of the resource, usually it is 'storageAccounts'. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * Indicates the type of storage account. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /* + * 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.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * The capability information in the specified SKU, including file encryption, network ACLs, change notification, + * etc. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @param name the name value to set. + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the resourceType property: The type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the kind property: Indicates the type of storage account. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the locations property: 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.). + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the capabilities property: The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @param restrictions the restrictions value to set. + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model SkuInformationInner")); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SkuInformationInner.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java new file mode 100644 index 0000000000000..d1f5d21c6d162 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java @@ -0,0 +1,812 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The storage account. */ +@Fluent +public final class StorageAccountInner extends Resource { + /* + * Gets the SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * Gets the Kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Properties of the storage account. + */ + @JsonProperty(value = "properties") + private StorageAccountPropertiesInner innerProperties; + + /** + * Get the sku property: Gets the SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the kind property: Gets the Kind. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: Properties of the storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public StorageAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the primaryEndpoints property: 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. + * + * @return the primaryEndpoints value. + */ + public Endpoints primaryEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().primaryEndpoints(); + } + + /** + * Get the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.innerProperties() == null ? null : this.innerProperties().primaryLocation(); + } + + /** + * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + public AccountStatus statusOfPrimary() { + return this.innerProperties() == null ? null : this.innerProperties().statusOfPrimary(); + } + + /** + * Get the lastGeoFailoverTime property: 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. + * + * @return the lastGeoFailoverTime value. + */ + public OffsetDateTime lastGeoFailoverTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastGeoFailoverTime(); + } + + /** + * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + public String secondaryLocation() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryLocation(); + } + + /** + * Get the statusOfSecondary property: 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. + * + * @return the statusOfSecondary value. + */ + public AccountStatus statusOfSecondary() { + return this.innerProperties() == null ? null : this.innerProperties().statusOfSecondary(); + } + + /** + * Get the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Get the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + public KeyCreationTime keyCreationTime() { + return this.innerProperties() == null ? null : this.innerProperties().keyCreationTime(); + } + + /** + * Get the secondaryEndpoints property: 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. + * + * @return the secondaryEndpoints value. + */ + public Endpoints secondaryEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryEndpoints(); + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsHnsEnabled(isHnsEnabled); + return this; + } + + /** + * Get the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + public GeoReplicationStats geoReplicationStats() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplicationStats(); + } + + /** + * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + public Boolean failoverInProgress() { + return this.innerProperties() == null ? null : this.innerProperties().failoverInProgress(); + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.innerProperties() == null ? null : this.innerProperties().blobRestoreStatus(); + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3(); + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableNfsV3(Boolean enableNfsV3) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withEnableNfsV3(enableNfsV3); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountSkuConversionStatus(); + } + + /** + * Set the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @param storageAccountSkuConversionStatus the storageAccountSkuConversionStatus value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withStorageAccountSkuConversionStatus( + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withStorageAccountSkuConversionStatus(storageAccountSkuConversionStatus); + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java new file mode 100644 index 0000000000000..81871decdd5b5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.models.StorageAccountKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the ListKeys operation. */ +@Immutable +public final class StorageAccountListKeysResultInner { + /* + * Gets the list of storage account keys and their properties for the specified storage account. + */ + @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) + private List keys; + + /** + * Get the keys property: Gets the list of storage account keys and their properties for the specified storage + * account. + * + * @return the keys value. + */ + public List keys() { + return this.keys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keys() != null) { + keys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java new file mode 100644 index 0000000000000..2b92eadff054a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to create the storage account. */ +@Fluent +public final class StorageAccountPropertiesCreateParameters { + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + @JsonProperty(value = "allowedCopyScope") + private AllowedCopyScope allowedCopyScope; + + /* + * Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be + * 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "sasPolicy") + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "keyPolicy") + private KeyPolicy keyPolicy; + + /* + * 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. + */ + @JsonProperty(value = "customDomain") + private CustomDomain customDomain; + + /* + * Encryption settings to be used for server-side encryption for the storage account. + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * Network rule set + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkRuleSet; + + /* + * 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. + */ + @JsonProperty(value = "accessTier") + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. The default value is true since API version + * 2019-04-01. + */ + @JsonProperty(value = "supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + @JsonProperty(value = "isSftpEnabled") + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + @JsonProperty(value = "isLocalUserEnabled") + private Boolean isLocalUserEnabled; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "isHnsEnabled") + private Boolean isHnsEnabled; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + @JsonProperty(value = "largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + @JsonProperty(value = "routingPreference") + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * true for this property. + */ + @JsonProperty(value = "allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + @JsonProperty(value = "minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /* + * 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. + */ + @JsonProperty(value = "allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + @JsonProperty(value = "isNfsV3Enabled") + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + */ + @JsonProperty(value = "allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + @JsonProperty(value = "defaultToOAuthAuthentication") + private Boolean defaultToOAuthAuthentication; + + /* + * 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. + */ + @JsonProperty(value = "immutableStorageWithVersioning") + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * 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. + */ + @JsonProperty(value = "dnsEndpointType") + private DnsEndpointType dnsEndpointType; + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withSasPolicy(SasPolicy sasPolicy) { + this.sasPolicy = sasPolicy; + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withKeyPolicy(KeyPolicy keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the customDomain property: 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. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set the customDomain property: 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. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @param encryption the encryption value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: 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. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withLargeFileSharesState( + LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.enableNfsV3; + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowCrossTenantReplication( + Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withDefaultToOAuthAuthentication( + Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (customDomain() != null) { + customDomain().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java new file mode 100644 index 0000000000000..5c804af1ee802 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java @@ -0,0 +1,919 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Properties of the storage account. */ +@Fluent +public final class StorageAccountPropertiesInner { + /* + * Gets the status of the storage account at the time the operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * 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. + */ + @JsonProperty(value = "primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints primaryEndpoints; + + /* + * Gets the location of the primary data center for the storage account. + */ + @JsonProperty(value = "primaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String primaryLocation; + + /* + * Gets the status indicating whether the primary location of the storage account is available or unavailable. + */ + @JsonProperty(value = "statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfPrimary; + + /* + * 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. + */ + @JsonProperty(value = "lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastGeoFailoverTime; + + /* + * Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is + * Standard_GRS or Standard_RAGRS. + */ + @JsonProperty(value = "secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryLocation; + + /* + * 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. + */ + @JsonProperty(value = "statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfSecondary; + + /* + * Gets the creation date and time of the storage account in UTC. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets the custom domain the user assigned to this storage account. + */ + @JsonProperty(value = "customDomain", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomain customDomain; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "sasPolicy", access = JsonProperty.Access.WRITE_ONLY) + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "keyPolicy", access = JsonProperty.Access.WRITE_ONLY) + private KeyPolicy keyPolicy; + + /* + * Storage account keys creation time. + */ + @JsonProperty(value = "keyCreationTime", access = JsonProperty.Access.WRITE_ONLY) + private KeyCreationTime keyCreationTime; + + /* + * 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. + */ + @JsonProperty(value = "secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints secondaryEndpoints; + + /* + * Encryption settings to be used for server-side encryption for the storage account. + */ + @JsonProperty(value = "encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /* + * 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. + */ + @JsonProperty(value = "accessTier", access = JsonProperty.Access.WRITE_ONLY) + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Network rule set + */ + @JsonProperty(value = "networkAcls", access = JsonProperty.Access.WRITE_ONLY) + private NetworkRuleSet networkRuleSet; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + @JsonProperty(value = "isSftpEnabled") + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + @JsonProperty(value = "isLocalUserEnabled") + private Boolean isLocalUserEnabled; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "isHnsEnabled") + private Boolean isHnsEnabled; + + /* + * Geo Replication Stats + */ + @JsonProperty(value = "geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStats geoReplicationStats; + + /* + * If the failover is in progress, the value will be true, otherwise, it will be null. + */ + @JsonProperty(value = "failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean failoverInProgress; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + @JsonProperty(value = "largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * List of private endpoint connection associated with the specified storage account + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + @JsonProperty(value = "routingPreference") + private RoutingPreference routingPreference; + + /* + * Blob restore status + */ + @JsonProperty(value = "blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreStatusInner blobRestoreStatus; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * true for this property. + */ + @JsonProperty(value = "allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + @JsonProperty(value = "minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /* + * 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. + */ + @JsonProperty(value = "allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + @JsonProperty(value = "isNfsV3Enabled") + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + */ + @JsonProperty(value = "allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + @JsonProperty(value = "defaultToOAuthAuthentication") + private Boolean defaultToOAuthAuthentication; + + /* + * Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be + * 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * 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. + */ + @JsonProperty(value = "immutableStorageWithVersioning") + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + @JsonProperty(value = "allowedCopyScope") + private AllowedCopyScope allowedCopyScope; + + /* + * This property is readOnly and is set by server during asynchronous storage account sku conversion operations. + */ + @JsonProperty(value = "storageAccountSkuConversionStatus") + private StorageAccountSkuConversionStatus storageAccountSkuConversionStatus; + + /* + * 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. + */ + @JsonProperty(value = "dnsEndpointType") + private DnsEndpointType dnsEndpointType; + + /** + * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the primaryEndpoints property: 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. + * + * @return the primaryEndpoints value. + */ + public Endpoints primaryEndpoints() { + return this.primaryEndpoints; + } + + /** + * Get the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + public AccountStatus statusOfPrimary() { + return this.statusOfPrimary; + } + + /** + * Get the lastGeoFailoverTime property: 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. + * + * @return the lastGeoFailoverTime value. + */ + public OffsetDateTime lastGeoFailoverTime() { + return this.lastGeoFailoverTime; + } + + /** + * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + public String secondaryLocation() { + return this.secondaryLocation; + } + + /** + * Get the statusOfSecondary property: 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. + * + * @return the statusOfSecondary value. + */ + public AccountStatus statusOfSecondary() { + return this.statusOfSecondary; + } + + /** + * Get the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Get the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + public KeyCreationTime keyCreationTime() { + return this.keyCreationTime; + } + + /** + * Get the secondaryEndpoints property: 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. + * + * @return the secondaryEndpoints value. + */ + public Endpoints secondaryEndpoints() { + return this.secondaryEndpoints; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + public GeoReplicationStats geoReplicationStats() { + return this.geoReplicationStats; + } + + /** + * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + public Boolean failoverInProgress() { + return this.failoverInProgress; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.blobRestoreStatus; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.enableNfsV3; + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.storageAccountSkuConversionStatus; + } + + /** + * Set the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @param storageAccountSkuConversionStatus the storageAccountSkuConversionStatus value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withStorageAccountSkuConversionStatus( + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus) { + this.storageAccountSkuConversionStatus = storageAccountSkuConversionStatus; + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryEndpoints() != null) { + primaryEndpoints().validate(); + } + if (customDomain() != null) { + customDomain().validate(); + } + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (keyCreationTime() != null) { + keyCreationTime().validate(); + } + if (secondaryEndpoints() != null) { + secondaryEndpoints().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (geoReplicationStats() != null) { + geoReplicationStats().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (blobRestoreStatus() != null) { + blobRestoreStatus().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + if (storageAccountSkuConversionStatus() != null) { + storageAccountSkuConversionStatus().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..d553fbc9d219b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java @@ -0,0 +1,663 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when updating a storage account. */ +@Fluent +public final class StorageAccountPropertiesUpdateParameters { + /* + * 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. + */ + @JsonProperty(value = "customDomain") + private CustomDomain customDomain; + + /* + * Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be + * disabled. + */ + @JsonProperty(value = "encryption") + private Encryption encryption; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "sasPolicy") + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "keyPolicy") + private KeyPolicy keyPolicy; + + /* + * 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. + */ + @JsonProperty(value = "accessTier") + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + @JsonProperty(value = "isSftpEnabled") + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + @JsonProperty(value = "isLocalUserEnabled") + private Boolean isLocalUserEnabled; + + /* + * Network rule set + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkRuleSet; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + @JsonProperty(value = "largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + @JsonProperty(value = "routingPreference") + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * true for this property. + */ + @JsonProperty(value = "allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + @JsonProperty(value = "minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + + /* + * 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. + */ + @JsonProperty(value = "allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + */ + @JsonProperty(value = "allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + @JsonProperty(value = "defaultToOAuthAuthentication") + private Boolean defaultToOAuthAuthentication; + + /* + * Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be + * 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * 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. + */ + @JsonProperty(value = "immutableStorageWithVersioning") + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + @JsonProperty(value = "allowedCopyScope") + private AllowedCopyScope allowedCopyScope; + + /* + * 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. + */ + @JsonProperty(value = "dnsEndpointType") + private DnsEndpointType dnsEndpointType; + + /** + * Get the customDomain property: 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. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set the customDomain property: 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. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @param encryption the encryption value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withSasPolicy(SasPolicy sasPolicy) { + this.sasPolicy = sasPolicy; + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withKeyPolicy(KeyPolicy keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: 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. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withLargeFileSharesState( + LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowCrossTenantReplication( + Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withDefaultToOAuthAuthentication( + Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomain() != null) { + customDomain().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java new file mode 100644 index 0000000000000..333b45c48d134 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The StorageQueue model. */ +@Fluent +public final class StorageQueueInner extends ProxyResource { + /* + * Queue resource properties. + */ + @JsonProperty(value = "properties") + private QueueProperties innerQueueProperties; + + /** + * Get the innerQueueProperties property: Queue resource properties. + * + * @return the innerQueueProperties value. + */ + private QueueProperties innerQueueProperties() { + return this.innerQueueProperties; + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the StorageQueueInner object itself. + */ + public StorageQueueInner withMetadata(Map metadata) { + if (this.innerQueueProperties() == null) { + this.innerQueueProperties = new QueueProperties(); + } + this.innerQueueProperties().withMetadata(metadata); + return this; + } + + /** + * Get the approximateMessageCount property: 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. + * + * @return the approximateMessageCount value. + */ + public Integer approximateMessageCount() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().approximateMessageCount(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueProperties() != null) { + innerQueueProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java new file mode 100644 index 0000000000000..66cd593db5bd8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the table, including Id, resource name, resource type. */ +@Fluent +public final class TableInner extends ProxyResource { + /* + * Table resource properties. + */ + @JsonProperty(value = "properties") + private TableProperties innerTableProperties; + + /** + * Get the innerTableProperties property: Table resource properties. + * + * @return the innerTableProperties value. + */ + private TableProperties innerTableProperties() { + return this.innerTableProperties; + } + + /** + * Get the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + public String tableName() { + return this.innerTableProperties() == null ? null : this.innerTableProperties().tableName(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerTableProperties() == null ? null : this.innerTableProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the table. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the TableInner object itself. + */ + public TableInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerTableProperties() == null) { + this.innerTableProperties = new TableProperties(); + } + this.innerTableProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerTableProperties() != null) { + innerTableProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java new file mode 100644 index 0000000000000..3b881b91c9bc4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The TableProperties model. */ +@Fluent +public final class TableProperties { + /* + * Table name under the specified account + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * List of stored access policies specified on the table. + */ + @JsonProperty(value = "signedIdentifiers") + private List signedIdentifiers; + + /** + * Get the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.signedIdentifiers; + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the table. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the TableProperties object itself. + */ + public TableProperties withSignedIdentifiers(List signedIdentifiers) { + this.signedIdentifiers = signedIdentifiers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java new file mode 100644 index 0000000000000..07d73bb753b5b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Table service. */ +@Fluent +public final class TableServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Table service. + */ + @JsonProperty(value = "properties") + private TableServicePropertiesProperties innerTableServiceProperties; + + /** + * Get the innerTableServiceProperties property: The properties of a storage account’s Table service. + * + * @return the innerTableServiceProperties value. + */ + private TableServicePropertiesProperties innerTableServiceProperties() { + return this.innerTableServiceProperties; + } + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerTableServiceProperties() == null ? null : this.innerTableServiceProperties().cors(); + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the TableServicePropertiesInner object itself. + */ + public TableServicePropertiesInner withCors(CorsRules cors) { + if (this.innerTableServiceProperties() == null) { + this.innerTableServiceProperties = new TableServicePropertiesProperties(); + } + this.innerTableServiceProperties().withCors(cors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerTableServiceProperties() != null) { + innerTableServiceProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java new file mode 100644 index 0000000000000..cefd545ec8c0f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Table service. */ +@Fluent +public final class TableServicePropertiesProperties { + /* + * 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. + */ + @JsonProperty(value = "cors") + private CorsRules cors; + + /** + * Get the cors property: 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. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: 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. + * + * @param cors the cors value to set. + * @return the TableServicePropertiesProperties object itself. + */ + public TableServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..20959ab6b3814 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.models.UsageName; +import com.azure.resourcemanager.storage.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Storage Resource Usage. */ +@Immutable +public final class UsageInner { + /* + * Gets the unit of measurement. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /* + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /* + * Gets the maximum count of the resources that can be allocated in the subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /* + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get the unit property: Gets the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get the currentValue property: Gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: Gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name property: Gets the name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..dec7a10810ff7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for StorageManagementClient. The Azure Storage Management API. */ +package com.azure.resourcemanager.storage.generated.fluent.models; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java new file mode 100644 index 0000000000000..e75af1291733e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for StorageManagementClient. The Azure Storage Management API. */ +package com.azure.resourcemanager.storage.generated.fluent; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java new file mode 100644 index 0000000000000..f9be7643a93b4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class BlobContainerImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { + private BlobContainerInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public String defaultEncryptionScope() { + return this.innerModel().defaultEncryptionScope(); + } + + public Boolean denyEncryptionScopeOverride() { + return this.innerModel().denyEncryptionScopeOverride(); + } + + public PublicAccess publicAccess() { + return this.innerModel().publicAccess(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerModel().immutabilityPolicy(); + } + + public LegalHoldProperties legalHold() { + return this.innerModel().legalHold(); + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public Boolean hasImmutabilityPolicy() { + return this.innerModel().hasImmutabilityPolicy(); + } + + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public Boolean enableNfsV3RootSquash() { + return this.innerModel().enableNfsV3RootSquash(); + } + + public Boolean enableNfsV3AllSquash() { + return this.innerModel().enableNfsV3AllSquash(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String containerName; + + public BlobContainerImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobContainer create() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobContainer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobContainerImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobContainerInner(); + this.serviceManager = serviceManager; + this.containerName = name; + } + + public BlobContainerImpl update() { + return this; + } + + public BlobContainer apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .updateWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobContainer apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .updateWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobContainerImpl( + BlobContainerInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = Utils.getValueFromIdByName(innerObject.id(), "containers"); + } + + public BlobContainer refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .getWithResponse(resourceGroupName, accountName, containerName, Context.NONE) + .getValue(); + return this; + } + + public BlobContainer refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .getWithResponse(resourceGroupName, accountName, containerName, context) + .getValue(); + return this; + } + + public LegalHold setLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().setLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response setLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager + .blobContainers() + .setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LegalHold clearLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().clearLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response clearLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager + .blobContainers() + .clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LeaseContainerResponse lease() { + return serviceManager.blobContainers().lease(resourceGroupName, accountName, containerName); + } + + public Response leaseWithResponse(LeaseContainerRequest parameters, Context context) { + return serviceManager + .blobContainers() + .leaseWithResponse(resourceGroupName, accountName, containerName, parameters, context); + } + + public void objectLevelWorm() { + serviceManager.blobContainers().objectLevelWorm(resourceGroupName, accountName, containerName); + } + + public void objectLevelWorm(Context context) { + serviceManager.blobContainers().objectLevelWorm(resourceGroupName, accountName, containerName, context); + } + + public BlobContainerImpl withDefaultEncryptionScope(String defaultEncryptionScope) { + this.innerModel().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + public BlobContainerImpl withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.innerModel().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + this.innerModel().withPublicAccess(publicAccess); + return this; + } + + public BlobContainerImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public BlobContainerImpl withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.innerModel().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + public BlobContainerImpl withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + this.innerModel().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + public BlobContainerImpl withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + this.innerModel().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java new file mode 100644 index 0000000000000..8875c4473391e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java @@ -0,0 +1,3575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.ListContainerItems; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BlobContainersClient. */ +public final class BlobContainersClientImpl implements BlobContainersClient { + /** The proxy service used to perform REST calls. */ + private final BlobContainersService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobContainersClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(BlobContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobContainers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface BlobContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, + @QueryParam("$filter") String filter, + @QueryParam("$include") ListContainersInclude include, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobContainerInner blobContainer, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobContainerInner blobContainer, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setLegalHold( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LegalHoldInner legalHold, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> clearLegalHold( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LegalHoldInner legalHold, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" + + "/{immutabilityPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdateImmutabilityPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") ImmutabilityPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" + + "/{immutabilityPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getImmutabilityPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" + + "/{immutabilityPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono deleteImmutabilityPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" + + "/default/lock") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono lockImmutabilityPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies" + + "/default/extend") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono extendImmutabilityPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") ImmutabilityPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> lease( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LeaseContainerRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> objectLevelWorm( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + include, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + include, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final ListContainersInclude include = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final ListContainersInclude include = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobContainer, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobContainer, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner create( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return createAsync(resourceGroupName, accountName, containerName, blobContainer).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobContainer, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobContainer, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner update( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return updateAsync(resourceGroupName, accountName, containerName, blobContainer).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String containerName) { + return getWithResponseAsync(resourceGroupName, accountName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner get(String resourceGroupName, String accountName, String containerName) { + return getAsync(resourceGroupName, accountName, containerName).block(); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String containerName) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String containerName) { + deleteAsync(resourceGroupName, accountName, containerName).block(); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setLegalHoldWithResponseAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setLegalHold( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + legalHold, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setLegalHoldWithResponseAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setLegalHold( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + legalHold, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setLegalHoldAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LegalHoldInner setLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return setLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearLegalHoldWithResponseAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .clearLegalHold( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + legalHold, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearLegalHoldWithResponseAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .clearLegalHold( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + legalHold, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono clearLegalHoldAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LegalHoldInner clearLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return clearLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context) + .block(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + createOrUpdateImmutabilityPolicyWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + createOrUpdateImmutabilityPolicyWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + parameters, + accept, + context); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateImmutabilityPolicyAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + return createOrUpdateImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName) { + final String ifMatch = null; + final ImmutabilityPolicyInner parameters = null; + return createOrUpdateImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName) { + final String ifMatch = null; + final ImmutabilityPolicyInner parameters = null; + return createOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) + .block(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context) { + return createOrUpdateImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters, context) + .block(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName) { + final String ifMatch = null; + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner getImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName) { + final String ifMatch = null; + return getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) + .block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + immutabilityPolicyName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner deleteImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + return deleteImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, context) + .block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .lockImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .lockImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner lockImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) + .block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .extendImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .extendImmutabilityPolicy( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + ifMatch, + parameters, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + return extendImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + final ImmutabilityPolicyInner parameters = null; + return extendImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner extendImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + final ImmutabilityPolicyInner parameters = null; + return extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) + .block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context) { + return extendImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters, context) + .block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> leaseWithResponseAsync( + String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .lease( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> leaseWithResponseAsync( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .lease( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync( + String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync( + String resourceGroupName, String accountName, String containerName) { + final LeaseContainerRequest parameters = null; + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName) { + final LeaseContainerRequest parameters = null; + return leaseAsync(resourceGroupName, accountName, containerName, parameters).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + Context context) { + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> objectLevelWormWithResponseAsync( + String resourceGroupName, String accountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .objectLevelWorm( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> objectLevelWormWithResponseAsync( + String resourceGroupName, String accountName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .objectLevelWorm( + this.client.getEndpoint(), + resourceGroupName, + accountName, + containerName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginObjectLevelWormAsync( + String resourceGroupName, String accountName, String containerName) { + Mono>> mono = + objectLevelWormWithResponseAsync(resourceGroupName, accountName, containerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginObjectLevelWormAsync( + String resourceGroupName, String accountName, String containerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + objectLevelWormWithResponseAsync(resourceGroupName, accountName, containerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName, Context context) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName, context).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono objectLevelWormAsync(String resourceGroupName, String accountName, String containerName) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono objectLevelWormAsync( + String resourceGroupName, String accountName, String containerName, Context context) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName) { + objectLevelWormAsync(resourceGroupName, accountName, containerName).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context) { + objectLevelWormAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java new file mode 100644 index 0000000000000..26d19b609bdb8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.BlobContainers; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicy; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import com.azure.resourcemanager.storage.generated.models.ListContainerItem; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +public final class BlobContainersImpl implements BlobContainers { + private static final ClientLogger LOGGER = new ClientLogger(BlobContainersImpl.class); + + private final BlobContainersClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobContainersImpl( + BlobContainersClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new ListContainerItemImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, include, context); + return Utils.mapPage(inner, inner1 -> new ListContainerItemImpl(inner1, this.manager())); + } + + public BlobContainer get(String resourceGroupName, String accountName, String containerName) { + BlobContainerInner inner = this.serviceClient().get(resourceGroupName, accountName, containerName); + if (inner != null) { + return new BlobContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, containerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BlobContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String containerName) { + this.serviceClient().delete(resourceGroupName, accountName, containerName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, containerName, context); + } + + public LegalHold setLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + LegalHoldInner inner = + this.serviceClient().setLegalHold(resourceGroupName, accountName, containerName, legalHold); + if (inner != null) { + return new LegalHoldImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response setLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + Response inner = + this + .serviceClient() + .setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LegalHoldImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LegalHold clearLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + LegalHoldInner inner = + this.serviceClient().clearLegalHold(resourceGroupName, accountName, containerName, legalHold); + if (inner != null) { + return new LegalHoldImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + Response inner = + this + .serviceClient() + .clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LegalHoldImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy getImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName) { + ImmutabilityPolicyInner inner = + this.serviceClient().getImmutabilityPolicy(resourceGroupName, accountName, containerName); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + BlobContainersGetImmutabilityPolicyResponse inner = + this + .serviceClient() + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy deleteImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + ImmutabilityPolicyInner inner = + this.serviceClient().deleteImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + BlobContainersDeleteImmutabilityPolicyResponse inner = + this + .serviceClient() + .deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy lockImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + ImmutabilityPolicyInner inner = + this.serviceClient().lockImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response lockImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + BlobContainersLockImmutabilityPolicyResponse inner = + this + .serviceClient() + .lockImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy extendImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + ImmutabilityPolicyInner inner = + this.serviceClient().extendImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response extendImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context) { + BlobContainersExtendImmutabilityPolicyResponse inner = + this + .serviceClient() + .extendImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, ifMatch, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LeaseContainerResponse lease(String resourceGroupName, String accountName, String containerName) { + LeaseContainerResponseInner inner = this.serviceClient().lease(resourceGroupName, accountName, containerName); + if (inner != null) { + return new LeaseContainerResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + Context context) { + Response inner = + this.serviceClient().leaseWithResponse(resourceGroupName, accountName, containerName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LeaseContainerResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName) { + this.serviceClient().objectLevelWorm(resourceGroupName, accountName, containerName); + } + + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context) { + this.serviceClient().objectLevelWorm(resourceGroupName, accountName, containerName, context); + } + + public BlobContainer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, containerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, containerName, context); + } + + public ImmutabilityPolicy getImmutabilityPolicyById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String localIfMatch = null; + return this + .getImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, localIfMatch, Context.NONE) + .getValue(); + } + + public Response getImmutabilityPolicyByIdWithResponse( + String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, containerName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, containerName, context); + } + + public ImmutabilityPolicy deleteImmutabilityPolicyById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String localIfMatch = null; + return this + .deleteImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, localIfMatch, Context.NONE) + .getValue(); + } + + public Response deleteImmutabilityPolicyByIdWithResponse( + String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this + .deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + } + + private BlobContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobContainerImpl define(String name) { + return new BlobContainerImpl(name, this.manager()); + } + + public ImmutabilityPolicyImpl defineImmutabilityPolicy() { + return new ImmutabilityPolicyImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java new file mode 100644 index 0000000000000..a544c6c266cad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java @@ -0,0 +1,890 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.ListBlobInventoryPolicy; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. */ +public final class BlobInventoryPoliciesClientImpl implements BlobInventoryPoliciesClient { + /** The proxy service used to perform REST calls. */ + private final BlobInventoryPoliciesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobInventoryPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobInventoryPoliciesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy + .create(BlobInventoryPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobInventoryPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface BlobInventoryPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @BodyParam("application/json") BlobInventoryPolicyInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/inventoryPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + accept, + context); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobInventoryPolicyInner get( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + return getAsync(resourceGroupName, accountName, blobInventoryPolicyName).block(); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + properties, + accept, + context); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobInventoryPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties) { + return createOrUpdateAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties).block(); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, blobInventoryPolicyName, properties, context) + .block(); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobInventoryPolicyName, + accept, + context); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + deleteAsync(resourceGroupName, accountName, blobInventoryPolicyName).block(); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java new file mode 100644 index 0000000000000..b7015f04b98cc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicies; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicy; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +public final class BlobInventoryPoliciesImpl implements BlobInventoryPolicies { + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPoliciesImpl.class); + + private final BlobInventoryPoliciesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobInventoryPoliciesImpl( + BlobInventoryPoliciesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BlobInventoryPolicy get( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + BlobInventoryPolicyInner inner = + this.serviceClient().get(resourceGroupName, accountName, blobInventoryPolicyName); + if (inner != null) { + return new BlobInventoryPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BlobInventoryPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, blobInventoryPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new BlobInventoryPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new BlobInventoryPolicyImpl(inner1, this.manager())); + } + + public BlobInventoryPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + private BlobInventoryPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobInventoryPolicyImpl define(BlobInventoryPolicyName name) { + return new BlobInventoryPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java new file mode 100644 index 0000000000000..172f523fe1f8f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicy; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import java.time.OffsetDateTime; + +public final class BlobInventoryPolicyImpl + implements BlobInventoryPolicy, BlobInventoryPolicy.Definition, BlobInventoryPolicy.Update { + private BlobInventoryPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public BlobInventoryPolicySchema policy() { + return this.innerModel().policy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobInventoryPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private BlobInventoryPolicyName blobInventoryPolicyName; + + public BlobInventoryPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobInventoryPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobInventoryPolicyImpl( + BlobInventoryPolicyName name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobInventoryPolicyInner(); + this.serviceManager = serviceManager; + this.blobInventoryPolicyName = name; + } + + public BlobInventoryPolicyImpl update() { + return this; + } + + public BlobInventoryPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobInventoryPolicyImpl( + BlobInventoryPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "inventoryPolicies")); + } + + public BlobInventoryPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobInventoryPolicies() + .getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context) + .getValue(); + return this; + } + + public BlobInventoryPolicyImpl withPolicy(BlobInventoryPolicySchema policy) { + this.innerModel().withPolicy(policy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java new file mode 100644 index 0000000000000..115fcba0472b3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreProgressStatus; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; + +public final class BlobRestoreStatusImpl implements BlobRestoreStatus { + private BlobRestoreStatusInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + BlobRestoreStatusImpl( + BlobRestoreStatusInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BlobRestoreProgressStatus status() { + return this.innerModel().status(); + } + + public String failureReason() { + return this.innerModel().failureReason(); + } + + public String restoreId() { + return this.innerModel().restoreId(); + } + + public BlobRestoreParameters parameters() { + return this.innerModel().parameters(); + } + + public BlobRestoreStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java new file mode 100644 index 0000000000000..5a8485e6a3fa3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceProperties; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import com.azure.resourcemanager.storage.generated.models.Sku; + +public final class BlobServicePropertiesImpl + implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { + private BlobServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String defaultServiceVersion() { + return this.innerModel().defaultServiceVersion(); + } + + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.innerModel().deleteRetentionPolicy(); + } + + public Boolean isVersioningEnabled() { + return this.innerModel().isVersioningEnabled(); + } + + public Boolean automaticSnapshotPolicyEnabled() { + return this.innerModel().automaticSnapshotPolicyEnabled(); + } + + public ChangeFeed changeFeed() { + return this.innerModel().changeFeed(); + } + + public RestorePolicyProperties restorePolicy() { + return this.innerModel().restorePolicy(); + } + + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.innerModel().containerDeleteRetentionPolicy(); + } + + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.innerModel().lastAccessTimeTrackingPolicy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public BlobServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobServiceProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public BlobServicePropertiesImpl update() { + return this; + } + + public BlobServiceProperties apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobServicePropertiesImpl( + BlobServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public BlobServiceProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public BlobServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } + + public BlobServicePropertiesImpl withDefaultServiceVersion(String defaultServiceVersion) { + this.innerModel().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.innerModel().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + + public BlobServicePropertiesImpl withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.innerModel().withIsVersioningEnabled(isVersioningEnabled); + return this; + } + + public BlobServicePropertiesImpl withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.innerModel().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + return this; + } + + public BlobServicePropertiesImpl withChangeFeed(ChangeFeed changeFeed) { + this.innerModel().withChangeFeed(changeFeed); + return this; + } + + public BlobServicePropertiesImpl withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.innerModel().withRestorePolicy(restorePolicy); + return this; + } + + public BlobServicePropertiesImpl withContainerDeleteRetentionPolicy( + DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.innerModel().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); + return this; + } + + public BlobServicePropertiesImpl withLastAccessTimeTrackingPolicy( + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + this.innerModel().withLastAccessTimeTrackingPolicy(lastAccessTimeTrackingPolicy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java new file mode 100644 index 0000000000000..253a9abf07fea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java @@ -0,0 +1,640 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceItems; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BlobServicesClient. */ +public final class BlobServicesClientImpl implements BlobServicesClient { + /** The proxy service used to perform REST calls. */ + private final BlobServicesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobServicesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(BlobServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface BlobServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("BlobServicesName") String blobServicesName, + @BodyParam("application/json") BlobServicePropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("BlobServicesName") String blobServicesName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobServicesName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobServicesName, + parameters, + accept, + context); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobServicesName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blobServicesName, + accept, + context); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java new file mode 100644 index 0000000000000..19673a58ae42f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceProperties; +import com.azure.resourcemanager.storage.generated.models.BlobServices; + +public final class BlobServicesImpl implements BlobServices { + private static final ClientLogger LOGGER = new ClientLogger(BlobServicesImpl.class); + + private final BlobServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobServicesImpl( + BlobServicesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new BlobServicePropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new BlobServicePropertiesImpl(inner1, this.manager())); + } + + public BlobServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + BlobServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new BlobServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BlobServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BlobServiceProperties getServicePropertiesById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private BlobServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobServicePropertiesImpl define() { + return new BlobServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..99be5d76d11b1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storage.generated.models.Reason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java new file mode 100644 index 0000000000000..3d840edb6fb18 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccount; + +public final class DeletedAccountImpl implements DeletedAccount { + private DeletedAccountInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + DeletedAccountImpl( + DeletedAccountInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageAccountResourceId() { + return this.innerModel().storageAccountResourceId(); + } + + public String location() { + return this.innerModel().location(); + } + + public String restoreReference() { + return this.innerModel().restoreReference(); + } + + public String creationTime() { + return this.innerModel().creationTime(); + } + + public String deletionTime() { + return this.innerModel().deletionTime(); + } + + public DeletedAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java new file mode 100644 index 0000000000000..dbec5bd8ddd7c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccountListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeletedAccountsClient. */ +public final class DeletedAccountsClientImpl implements DeletedAccountsClient { + /** The proxy service used to perform REST calls. */ + private final DeletedAccountsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of DeletedAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeletedAccountsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(DeletedAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientDeletedAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface DeletedAccountsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts" + + "/{deletedAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deletedAccountName") String deletedAccountName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists deleted accounts under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deletedAccountName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deletedAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedAccountName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + deletedAccountName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deletedAccountName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deletedAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedAccountName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + deletedAccountName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deletedAccountName, String location) { + return getWithResponseAsync(deletedAccountName, location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedAccountInner get(String deletedAccountName, String location) { + return getAsync(deletedAccountName, location).block(); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String deletedAccountName, String location, Context context) { + return getWithResponseAsync(deletedAccountName, location, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java new file mode 100644 index 0000000000000..28f689fe877fd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccount; +import com.azure.resourcemanager.storage.generated.models.DeletedAccounts; + +public final class DeletedAccountsImpl implements DeletedAccounts { + private static final ClientLogger LOGGER = new ClientLogger(DeletedAccountsImpl.class); + + private final DeletedAccountsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public DeletedAccountsImpl( + DeletedAccountsClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + public DeletedAccount get(String deletedAccountName, String location) { + DeletedAccountInner inner = this.serviceClient().get(deletedAccountName, location); + if (inner != null) { + return new DeletedAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deletedAccountName, String location, Context context) { + Response inner = + this.serviceClient().getWithResponse(deletedAccountName, location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeletedAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private DeletedAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java new file mode 100644 index 0000000000000..2ffaca6741e57 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import java.time.OffsetDateTime; + +public final class EncryptionScopeImpl implements EncryptionScope, EncryptionScope.Definition, EncryptionScope.Update { + private EncryptionScopeInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EncryptionScopeSource source() { + return this.innerModel().source(); + } + + public EncryptionScopeState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.innerModel().keyVaultProperties(); + } + + public Boolean requireInfrastructureEncryption() { + return this.innerModel().requireInfrastructureEncryption(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EncryptionScopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String encryptionScopeName; + + public EncryptionScopeImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public EncryptionScope create() { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .putWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .putWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) + .getValue(); + return this; + } + + EncryptionScopeImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new EncryptionScopeInner(); + this.serviceManager = serviceManager; + this.encryptionScopeName = name; + } + + public EncryptionScopeImpl update() { + return this; + } + + public EncryptionScope apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .patchWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .patchWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) + .getValue(); + return this; + } + + EncryptionScopeImpl( + EncryptionScopeInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.encryptionScopeName = Utils.getValueFromIdByName(innerObject.id(), "encryptionScopes"); + } + + public EncryptionScope refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEncryptionScopes() + .getWithResponse(resourceGroupName, accountName, encryptionScopeName, context) + .getValue(); + return this; + } + + public EncryptionScopeImpl withSource(EncryptionScopeSource source) { + this.innerModel().withSource(source); + return this; + } + + public EncryptionScopeImpl withState(EncryptionScopeState state) { + this.innerModel().withState(state); + return this; + } + + public EncryptionScopeImpl withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.innerModel().withKeyVaultProperties(keyVaultProperties); + return this; + } + + public EncryptionScopeImpl withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.innerModel().withRequireInfrastructureEncryption(requireInfrastructureEncryption); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java new file mode 100644 index 0000000000000..8b1d4f43e7366 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java @@ -0,0 +1,1030 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EncryptionScopesClient. */ +public final class EncryptionScopesClientImpl implements EncryptionScopesClient { + /** The proxy service used to perform REST calls. */ + private final EncryptionScopesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of EncryptionScopesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EncryptionScopesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(EncryptionScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientEncryptionScopes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface EncryptionScopesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/encryptionScopes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + encryptionScope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + encryptionScope, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner put( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return putAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) + .block(); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + encryptionScope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + encryptionScope, + accept, + context); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner patch( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return patchAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).block(); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param encryptionScope Encryption scope properties to be used for the update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) + .block(); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String encryptionScopeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String encryptionScopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + encryptionScopeName, + accept, + context); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String encryptionScopeName) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName) { + return getAsync(resourceGroupName, accountName, encryptionScopeName).block(); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, context).block(); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java new file mode 100644 index 0000000000000..2cbbcce9c627b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopes; + +public final class EncryptionScopesImpl implements EncryptionScopes { + private static final ClientLogger LOGGER = new ClientLogger(EncryptionScopesImpl.class); + + private final EncryptionScopesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public EncryptionScopesImpl( + EncryptionScopesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName) { + EncryptionScopeInner inner = this.serviceClient().get(resourceGroupName, accountName, encryptionScopeName); + if (inner != null) { + return new EncryptionScopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EncryptionScopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public EncryptionScope getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String encryptionScopeName = Utils.getValueFromIdByName(id, "encryptionScopes"); + if (encryptionScopeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String encryptionScopeName = Utils.getValueFromIdByName(id, "encryptionScopes"); + if (encryptionScopeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); + } + + private EncryptionScopesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public EncryptionScopeImpl define(String name) { + return new EncryptionScopeImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java new file mode 100644 index 0000000000000..b1a4317367c15 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceItems; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class FileServiceItemsImpl implements FileServiceItems { + private FileServiceItemsInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + FileServiceItemsImpl( + FileServiceItemsInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new FileServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public FileServiceItemsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java new file mode 100644 index 0000000000000..e25b326f90fda --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.Sku; + +public final class FileServicePropertiesImpl + implements FileServiceProperties, FileServiceProperties.Definition, FileServiceProperties.Update { + private FileServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.innerModel().shareDeleteRetentionPolicy(); + } + + public ProtocolSettings protocolSettings() { + return this.innerModel().protocolSettings(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public FileServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public FileServiceProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + FileServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new FileServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public FileServicePropertiesImpl update() { + return this; + } + + public FileServiceProperties apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + FileServicePropertiesImpl( + FileServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public FileServiceProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFileServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public FileServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } + + public FileServicePropertiesImpl withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + this.innerModel().withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); + return this; + } + + public FileServicePropertiesImpl withProtocolSettings(ProtocolSettings protocolSettings) { + this.innerModel().withProtocolSettings(protocolSettings); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java new file mode 100644 index 0000000000000..e0ade18341867 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FileServicesClient. */ +public final class FileServicesClientImpl implements FileServicesClient { + /** The proxy service used to perform REST calls. */ + private final FileServicesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of FileServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileServicesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(FileServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientFileServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface FileServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/{FileServicesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, + @BodyParam("application/json") FileServicePropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/{FileServicesName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServiceItemsInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileServicesName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileServicesName, + parameters, + accept, + context); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { + return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of File services in storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileServicesName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileServicesName, + accept, + context); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java new file mode 100644 index 0000000000000..b925d54a1c3ff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceItems; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import com.azure.resourcemanager.storage.generated.models.FileServices; + +public final class FileServicesImpl implements FileServices { + private static final ClientLogger LOGGER = new ClientLogger(FileServicesImpl.class); + + private final FileServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public FileServicesImpl( + FileServicesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public FileServiceItems list(String resourceGroupName, String accountName) { + FileServiceItemsInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new FileServiceItemsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileServiceItemsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + FileServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new FileServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileServiceProperties getServicePropertiesById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private FileServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public FileServicePropertiesImpl define() { + return new FileServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java new file mode 100644 index 0000000000000..39cd1497a9eac --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FileShareImpl implements FileShare, FileShare.Definition, FileShare.Update { + private FileShareInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shareQuota() { + return this.innerModel().shareQuota(); + } + + public EnabledProtocols enabledProtocols() { + return this.innerModel().enabledProtocols(); + } + + public RootSquashType rootSquash() { + return this.innerModel().rootSquash(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public ShareAccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public OffsetDateTime accessTierChangeTime() { + return this.innerModel().accessTierChangeTime(); + } + + public String accessTierStatus() { + return this.innerModel().accessTierStatus(); + } + + public Long shareUsageBytes() { + return this.innerModel().shareUsageBytes(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime snapshotTime() { + return this.innerModel().snapshotTime(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileShareInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String shareName; + + private String createExpand; + + public FileShareImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public FileShare create() { + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .createWithResponse( + resourceGroupName, accountName, shareName, this.innerModel(), createExpand, Context.NONE) + .getValue(); + return this; + } + + public FileShare create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .createWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), createExpand, context) + .getValue(); + return this; + } + + FileShareImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new FileShareInner(); + this.serviceManager = serviceManager; + this.shareName = name; + this.createExpand = null; + } + + public FileShareImpl update() { + return this; + } + + public FileShare apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .updateWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileShare apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .updateWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), context) + .getValue(); + return this; + } + + FileShareImpl( + FileShareInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.shareName = Utils.getValueFromIdByName(innerObject.id(), "shares"); + } + + public FileShare refresh() { + String localExpand = null; + String localXMsSnapshot = null; + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, Context.NONE) + .getValue(); + return this; + } + + public FileShare refresh(Context context) { + String localExpand = null; + String localXMsSnapshot = null; + this.innerObject = + serviceManager + .serviceClient() + .getFileShares() + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, context) + .getValue(); + return this; + } + + public void restore(DeletedShare deletedShare) { + serviceManager.fileShares().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response restoreWithResponse(DeletedShare deletedShare, Context context) { + return serviceManager + .fileShares() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + public LeaseShareResponse lease() { + return serviceManager.fileShares().lease(resourceGroupName, accountName, shareName); + } + + public Response leaseWithResponse( + String xMsSnapshot, LeaseShareRequest parameters, Context context) { + return serviceManager + .fileShares() + .leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context); + } + + public FileShareImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public FileShareImpl withShareQuota(Integer shareQuota) { + this.innerModel().withShareQuota(shareQuota); + return this; + } + + public FileShareImpl withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.innerModel().withEnabledProtocols(enabledProtocols); + return this; + } + + public FileShareImpl withRootSquash(RootSquashType rootSquash) { + this.innerModel().withRootSquash(rootSquash); + return this; + } + + public FileShareImpl withAccessTier(ShareAccessTier accessTier) { + this.innerModel().withAccessTier(accessTier); + return this; + } + + public FileShareImpl withSignedIdentifiers(List signedIdentifiers) { + this.innerModel().withSignedIdentifiers(signedIdentifiers); + return this; + } + + public FileShareImpl withExpand(String expand) { + this.createExpand = expand; + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java new file mode 100644 index 0000000000000..5ee21438ba0a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileShareItem; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FileShareItemImpl implements FileShareItem { + private FileShareItemInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + FileShareItemImpl( + FileShareItemInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shareQuota() { + return this.innerModel().shareQuota(); + } + + public EnabledProtocols enabledProtocols() { + return this.innerModel().enabledProtocols(); + } + + public RootSquashType rootSquash() { + return this.innerModel().rootSquash(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public ShareAccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public OffsetDateTime accessTierChangeTime() { + return this.innerModel().accessTierChangeTime(); + } + + public String accessTierStatus() { + return this.innerModel().accessTierStatus(); + } + + public Long shareUsageBytes() { + return this.innerModel().shareUsageBytes(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime snapshotTime() { + return this.innerModel().snapshotTime(); + } + + public FileShareItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java new file mode 100644 index 0000000000000..2e043aae096eb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java @@ -0,0 +1,1888 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileShareItems; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FileSharesClient. */ +public final class FileSharesClientImpl implements FileSharesClient { + /** The proxy service used to perform REST calls. */ + private final FileSharesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of FileSharesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileSharesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(FileSharesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientFileShares to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface FileSharesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, + @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FileShareInner fileShare, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FileShareInner fileShare, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") String expand, + @HeaderParam("x-ms-snapshot") String xMsSnapshot, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("x-ms-snapshot") String xMsSnapshot, + @QueryParam("$include") String include, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> restore( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DeletedShare deletedShare, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono lease( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("x-ms-snapshot") String xMsSnapshot, + @BodyParam("application/json") LeaseShareRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context)); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + expand, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileShare, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String accountName, + String shareName, + FileShareInner fileShare, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + expand, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileShare, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, String expand) { + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + final String expand = null; + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner create( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + final String expand = null; + return createAsync(resourceGroupName, accountName, shareName, fileShare, expand).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String accountName, + String shareName, + FileShareInner fileShare, + String expand, + Context context) { + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileShare, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + fileShare, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner update( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateAsync(resourceGroupName, accountName, shareName, fileShare).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, context).block(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String shareName, String expand, String xMsSnapshot) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + xMsSnapshot, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + xMsSnapshot, + accept, + context); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String shareName, String expand, String xMsSnapshot) { + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String shareName) { + final String expand = null; + final String xMsSnapshot = null; + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner get(String resourceGroupName, String accountName, String shareName) { + final String expand = null; + final String xMsSnapshot = null; + return getAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot).block(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot, context).block(); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String shareName, String xMsSnapshot, String include) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + xMsSnapshot, + include, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + xMsSnapshot, + include, + accept, + context); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String shareName, String xMsSnapshot, String include) { + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final String include = null; + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final String include = null; + deleteAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include).block(); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include, context) + .block(); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restoreWithResponseAsync( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deletedShare == null) { + return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); + } else { + deletedShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restore( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + deletedShare, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restoreWithResponseAsync( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deletedShare == null) { + return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); + } else { + deletedShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restore( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + deletedShare, + accept, + context); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + restoreAsync(resourceGroupName, accountName, shareName, deletedShare).block(); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseWithResponseAsync( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .lease( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + xMsSnapshot, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseWithResponseAsync( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .lease( + this.client.getEndpoint(), + resourceGroupName, + accountName, + shareName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + xMsSnapshot, + parameters, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters) { + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final LeaseShareRequest parameters = null; + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LeaseShareResponseInner lease(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final LeaseShareRequest parameters = null; + return leaseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSharesLeaseResponse leaseWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters, + Context context) { + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java new file mode 100644 index 0000000000000..f0d273f141df3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.FileShareItem; +import com.azure.resourcemanager.storage.generated.models.FileShares; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; + +public final class FileSharesImpl implements FileShares { + private static final ClientLogger LOGGER = new ClientLogger(FileSharesImpl.class); + + private final FileSharesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public FileSharesImpl( + FileSharesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new FileShareItemImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, expand, context); + return Utils.mapPage(inner, inner1 -> new FileShareItemImpl(inner1, this.manager())); + } + + public FileShare get(String resourceGroupName, String accountName, String shareName) { + FileShareInner inner = this.serviceClient().get(resourceGroupName, accountName, shareName); + if (inner != null) { + return new FileShareImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, accountName, shareName, expand, xMsSnapshot, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileShareImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String shareName) { + this.serviceClient().delete(resourceGroupName, accountName, shareName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, include, context); + } + + public void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + this.serviceClient().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { + return this + .serviceClient() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + public LeaseShareResponse lease(String resourceGroupName, String accountName, String shareName) { + LeaseShareResponseInner inner = this.serviceClient().lease(resourceGroupName, accountName, shareName); + if (inner != null) { + return new LeaseShareResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response leaseWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters, + Context context) { + FileSharesLeaseResponse inner = + this + .serviceClient() + .leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LeaseShareResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileShare getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = Utils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + String localExpand = null; + String localXMsSnapshot = null; + return this + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, String xMsSnapshot, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = Utils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, shareName, expand, xMsSnapshot, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = Utils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + String localXMsSnapshot = null; + String localInclude = null; + this + .deleteWithResponse( + resourceGroupName, accountName, shareName, localXMsSnapshot, localInclude, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, String xMsSnapshot, String include, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = Utils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, include, context); + } + + private FileSharesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public FileShareImpl define(String name) { + return new FileShareImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java new file mode 100644 index 0000000000000..84b6d1ed013c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicy; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; + +public final class ImmutabilityPolicyImpl + implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { + private ImmutabilityPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerModel().immutabilityPeriodSinceCreationInDays(); + } + + public ImmutabilityPolicyState state() { + return this.innerModel().state(); + } + + public Boolean allowProtectedAppendWrites() { + return this.innerModel().allowProtectedAppendWrites(); + } + + public Boolean allowProtectedAppendWritesAll() { + return this.innerModel().allowProtectedAppendWritesAll(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ImmutabilityPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String containerName; + + private String createIfMatch; + + private String updateIfMatch; + + public ImmutabilityPolicyImpl withExistingContainer( + String resourceGroupName, String accountName, String containerName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.containerName = containerName; + return this; + } + + public ImmutabilityPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, createIfMatch, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, createIfMatch, this.innerModel(), context) + .getValue(); + return this; + } + + ImmutabilityPolicyImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ImmutabilityPolicyInner(); + this.serviceManager = serviceManager; + this.createIfMatch = null; + } + + public ImmutabilityPolicyImpl update() { + this.updateIfMatch = null; + return this; + } + + public ImmutabilityPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, updateIfMatch, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, updateIfMatch, this.innerModel(), context) + .getValue(); + return this; + } + + ImmutabilityPolicyImpl( + ImmutabilityPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = Utils.getValueFromIdByName(innerObject.id(), "containers"); + } + + public ImmutabilityPolicy refresh() { + String localIfMatch = null; + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .getImmutabilityPolicyWithResponse( + resourceGroupName, accountName, containerName, localIfMatch, Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy refresh(Context context) { + String localIfMatch = null; + this.innerObject = + serviceManager + .serviceClient() + .getBlobContainers() + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, localIfMatch, context) + .getValue(); + return this; + } + + public ImmutabilityPolicyImpl withImmutabilityPeriodSinceCreationInDays( + Integer immutabilityPeriodSinceCreationInDays) { + this.innerModel().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + public ImmutabilityPolicyImpl withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.innerModel().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + public ImmutabilityPolicyImpl withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.innerModel().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 0000000000000..07e2ecbd2b884 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; + +public final class LeaseContainerResponseImpl implements LeaseContainerResponse { + private LeaseContainerResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LeaseContainerResponseImpl( + LeaseContainerResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String leaseId() { + return this.innerModel().leaseId(); + } + + public String leaseTimeSeconds() { + return this.innerModel().leaseTimeSeconds(); + } + + public LeaseContainerResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java new file mode 100644 index 0000000000000..775b2061d835b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; + +public final class LeaseShareResponseImpl implements LeaseShareResponse { + private LeaseShareResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LeaseShareResponseImpl( + LeaseShareResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String leaseId() { + return this.innerModel().leaseId(); + } + + public String leaseTimeSeconds() { + return this.innerModel().leaseTimeSeconds(); + } + + public LeaseShareResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java new file mode 100644 index 0000000000000..8b29b768a6726 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import java.util.Collections; +import java.util.List; + +public final class LegalHoldImpl implements LegalHold { + private LegalHoldInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LegalHoldImpl( + LegalHoldInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public List tags() { + List inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean allowProtectedAppendWritesAll() { + return this.innerModel().allowProtectedAppendWritesAll(); + } + + public LegalHoldInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java new file mode 100644 index 0000000000000..f25e2893b4739 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; + +public final class ListAccountSasResponseImpl implements ListAccountSasResponse { + private ListAccountSasResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListAccountSasResponseImpl( + ListAccountSasResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accountSasToken() { + return this.innerModel().accountSasToken(); + } + + public ListAccountSasResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java new file mode 100644 index 0000000000000..1dcf522087f93 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.ListContainerItem; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class ListContainerItemImpl implements ListContainerItem { + private ListContainerItemInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListContainerItemImpl( + ListContainerItemInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public String defaultEncryptionScope() { + return this.innerModel().defaultEncryptionScope(); + } + + public Boolean denyEncryptionScopeOverride() { + return this.innerModel().denyEncryptionScopeOverride(); + } + + public PublicAccess publicAccess() { + return this.innerModel().publicAccess(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerModel().immutabilityPolicy(); + } + + public LegalHoldProperties legalHold() { + return this.innerModel().legalHold(); + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public Boolean hasImmutabilityPolicy() { + return this.innerModel().hasImmutabilityPolicy(); + } + + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public Boolean enableNfsV3RootSquash() { + return this.innerModel().enableNfsV3RootSquash(); + } + + public Boolean enableNfsV3AllSquash() { + return this.innerModel().enableNfsV3AllSquash(); + } + + public ListContainerItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java new file mode 100644 index 0000000000000..1d661e956ca83 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueue; +import java.util.Collections; +import java.util.Map; + +public final class ListQueueImpl implements ListQueue { + private ListQueueInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListQueueImpl( + ListQueueInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ListQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java new file mode 100644 index 0000000000000..1607329b37bba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueServices; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ListQueueServicesImpl implements ListQueueServices { + private ListQueueServicesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListQueueServicesImpl( + ListQueueServicesInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new QueueServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ListQueueServicesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java new file mode 100644 index 0000000000000..0c693fc99f586 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; + +public final class ListServiceSasResponseImpl implements ListServiceSasResponse { + private ListServiceSasResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListServiceSasResponseImpl( + ListServiceSasResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceSasToken() { + return this.innerModel().serviceSasToken(); + } + + public ListServiceSasResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java new file mode 100644 index 0000000000000..6c789363556de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListTableServices; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ListTableServicesImpl implements ListTableServices { + private ListTableServicesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListTableServicesImpl( + ListTableServicesInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new TableServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ListTableServicesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java new file mode 100644 index 0000000000000..8dc52360643e4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Collections; +import java.util.List; + +public final class LocalUserImpl implements LocalUser, LocalUser.Definition, LocalUser.Update { + private LocalUserInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List permissionScopes() { + List inner = this.innerModel().permissionScopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String homeDirectory() { + return this.innerModel().homeDirectory(); + } + + public List sshAuthorizedKeys() { + List inner = this.innerModel().sshAuthorizedKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sid() { + return this.innerModel().sid(); + } + + public Boolean hasSharedKey() { + return this.innerModel().hasSharedKey(); + } + + public Boolean hasSshKey() { + return this.innerModel().hasSshKey(); + } + + public Boolean hasSshPassword() { + return this.innerModel().hasSshPassword(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LocalUserInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String username; + + public LocalUserImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public LocalUser create() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public LocalUser create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), context) + .getValue(); + return this; + } + + LocalUserImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new LocalUserInner(); + this.serviceManager = serviceManager; + this.username = name; + } + + public LocalUserImpl update() { + return this; + } + + public LocalUser apply() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public LocalUser apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), context) + .getValue(); + return this; + } + + LocalUserImpl( + LocalUserInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.username = Utils.getValueFromIdByName(innerObject.id(), "localUsers"); + } + + public LocalUser refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .getWithResponse(resourceGroupName, accountName, username, Context.NONE) + .getValue(); + return this; + } + + public LocalUser refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getLocalUsersOperations() + .getWithResponse(resourceGroupName, accountName, username, context) + .getValue(); + return this; + } + + public LocalUserKeys listKeys() { + return serviceManager.localUsersOperations().listKeys(resourceGroupName, accountName, username); + } + + public Response listKeysWithResponse(Context context) { + return serviceManager + .localUsersOperations() + .listKeysWithResponse(resourceGroupName, accountName, username, context); + } + + public LocalUserRegeneratePasswordResult regeneratePassword() { + return serviceManager.localUsersOperations().regeneratePassword(resourceGroupName, accountName, username); + } + + public Response regeneratePasswordWithResponse(Context context) { + return serviceManager + .localUsersOperations() + .regeneratePasswordWithResponse(resourceGroupName, accountName, username, context); + } + + public LocalUserImpl withPermissionScopes(List permissionScopes) { + this.innerModel().withPermissionScopes(permissionScopes); + return this; + } + + public LocalUserImpl withHomeDirectory(String homeDirectory) { + this.innerModel().withHomeDirectory(homeDirectory); + return this; + } + + public LocalUserImpl withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.innerModel().withSshAuthorizedKeys(sshAuthorizedKeys); + return this; + } + + public LocalUserImpl withHasSharedKey(Boolean hasSharedKey) { + this.innerModel().withHasSharedKey(hasSharedKey); + return this; + } + + public LocalUserImpl withHasSshKey(Boolean hasSshKey) { + this.innerModel().withHasSshKey(hasSshKey); + return this; + } + + public LocalUserImpl withHasSshPassword(Boolean hasSshPassword) { + this.innerModel().withHasSshPassword(hasSshPassword); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java new file mode 100644 index 0000000000000..c1589670a0208 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Collections; +import java.util.List; + +public final class LocalUserKeysImpl implements LocalUserKeys { + private LocalUserKeysInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LocalUserKeysImpl( + LocalUserKeysInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List sshAuthorizedKeys() { + List inner = this.innerModel().sshAuthorizedKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public LocalUserKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java new file mode 100644 index 0000000000000..54cd954baa0e8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; + +public final class LocalUserRegeneratePasswordResultImpl implements LocalUserRegeneratePasswordResult { + private LocalUserRegeneratePasswordResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LocalUserRegeneratePasswordResultImpl( + LocalUserRegeneratePasswordResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sshPassword() { + return this.innerModel().sshPassword(); + } + + public LocalUserRegeneratePasswordResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java new file mode 100644 index 0000000000000..2839aaf79ae44 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java @@ -0,0 +1,1214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.LocalUsers; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocalUsersOperationsClient. */ +public final class LocalUsersOperationsClientImpl implements LocalUsersOperationsClient { + /** The proxy service used to perform REST calls. */ + private final LocalUsersOperationsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of LocalUsersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocalUsersOperationsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy + .create(LocalUsersOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientLocalUsersOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface LocalUsersOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, + @BodyParam("application/json") LocalUserInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers/{username}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regeneratePassword( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String username) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String username) { + return getWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserInner get(String resourceGroupName, String accountName, String username) { + return getAsync(resourceGroupName, accountName, username).block(); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String username, LocalUserInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String username, LocalUserInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + properties, + accept, + context); + } + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String accountName, String username, LocalUserInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, username, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserInner createOrUpdate( + String resourceGroupName, String accountName, String username, LocalUserInner properties) { + return createOrUpdateAsync(resourceGroupName, accountName, username, properties).block(); + } + + /** + * Create or update the properties of a local user associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String accountName, String username, LocalUserInner properties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, username, properties, context).block(); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String username) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String username) { + return deleteWithResponseAsync(resourceGroupName, accountName, username).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String username) { + deleteAsync(resourceGroupName, accountName, username).block(); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String accountName, String username) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String accountName, String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String accountName, String username) { + return listKeysWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserKeysInner listKeys(String resourceGroupName, String accountName, String username) { + return listKeysAsync(resourceGroupName, accountName, username).block(); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePasswordWithResponseAsync( + String resourceGroupName, String accountName, String username) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regeneratePassword( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePasswordWithResponseAsync( + String resourceGroupName, String accountName, String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regeneratePassword( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + username, + accept, + context); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regeneratePasswordAsync( + String resourceGroupName, String accountName, String username) { + return regeneratePasswordWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserRegeneratePasswordResultInner regeneratePassword( + String resourceGroupName, String accountName, String username) { + return regeneratePasswordAsync(resourceGroupName, accountName, username).block(); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regeneratePasswordWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + return regeneratePasswordWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java new file mode 100644 index 0000000000000..af0ca6374c8db --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; +import com.azure.resourcemanager.storage.generated.models.LocalUsersOperations; + +public final class LocalUsersOperationsImpl implements LocalUsersOperations { + private static final ClientLogger LOGGER = new ClientLogger(LocalUsersOperationsImpl.class); + + private final LocalUsersOperationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public LocalUsersOperationsImpl( + LocalUsersOperationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new LocalUserImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new LocalUserImpl(inner1, this.manager())); + } + + public LocalUser get(String resourceGroupName, String accountName, String username) { + LocalUserInner inner = this.serviceClient().get(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocalUserImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String username) { + this.serviceClient().delete(resourceGroupName, accountName, username); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, username, context); + } + + public LocalUserKeys listKeys(String resourceGroupName, String accountName, String username) { + LocalUserKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocalUserKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LocalUserRegeneratePasswordResult regeneratePassword( + String resourceGroupName, String accountName, String username) { + LocalUserRegeneratePasswordResultInner inner = + this.serviceClient().regeneratePassword(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserRegeneratePasswordResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regeneratePasswordWithResponse( + String resourceGroupName, String accountName, String username, Context context) { + Response inner = + this.serviceClient().regeneratePasswordWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocalUserRegeneratePasswordResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LocalUser getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = Utils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, username, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = Utils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, username, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = Utils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, username, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = Utils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, username, context); + } + + private LocalUsersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public LocalUserImpl define(String name) { + return new LocalUserImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java new file mode 100644 index 0000000000000..c2fa1b3e3bec5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java @@ -0,0 +1,648 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagementPoliciesClient. */ +public final class ManagementPoliciesClientImpl implements ManagementPoliciesClient { + /** The proxy service used to perform REST calls. */ + private final ManagementPoliciesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of ManagementPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementPoliciesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(ManagementPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientManagementPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface ManagementPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, + @BodyParam("application/json") ManagementPolicyInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, + Context context); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + accept, + context); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagementPolicyInner get( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return getAsync(resourceGroupName, accountName, managementPolicyName).block(); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + properties, + accept, + context); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagementPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties) { + return createOrUpdateAsync(resourceGroupName, accountName, managementPolicyName, properties).block(); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, managementPolicyName, properties, context) + .block(); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + managementPolicyName, + context); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + deleteAsync(resourceGroupName, accountName, managementPolicyName).block(); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java new file mode 100644 index 0000000000000..3e69ddd519946 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicies; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicy; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +public final class ManagementPoliciesImpl implements ManagementPolicies { + private static final ClientLogger LOGGER = new ClientLogger(ManagementPoliciesImpl.class); + + private final ManagementPoliciesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public ManagementPoliciesImpl( + ManagementPoliciesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagementPolicy get( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + ManagementPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, managementPolicyName); + if (inner != null) { + return new ManagementPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, managementPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagementPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, managementPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + public ManagementPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + private ManagementPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public ManagementPolicyImpl define(ManagementPolicyName name) { + return new ManagementPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java new file mode 100644 index 0000000000000..81ff98f29e22e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicy; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import java.time.OffsetDateTime; + +public final class ManagementPolicyImpl + implements ManagementPolicy, ManagementPolicy.Definition, ManagementPolicy.Update { + private ManagementPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public ManagementPolicySchema policy() { + return this.innerModel().policy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagementPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private ManagementPolicyName managementPolicyName; + + public ManagementPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ManagementPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, managementPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, managementPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + ManagementPolicyImpl( + ManagementPolicyName name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ManagementPolicyInner(); + this.serviceManager = serviceManager; + this.managementPolicyName = name; + } + + public ManagementPolicyImpl update() { + return this; + } + + public ManagementPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, managementPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, managementPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + ManagementPolicyImpl( + ManagementPolicyInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "managementPolicies")); + } + + public ManagementPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .getWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagementPolicies() + .getWithResponse(resourceGroupName, accountName, managementPolicyName, context) + .getValue(); + return this; + } + + public ManagementPolicyImpl withPolicy(ManagementPolicySchema policy) { + this.innerModel().withPolicy(policy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java new file mode 100644 index 0000000000000..bbf9a96b5b796 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java @@ -0,0 +1,919 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicies; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. + */ +public final class ObjectReplicationPoliciesOperationsClientImpl implements ObjectReplicationPoliciesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ObjectReplicationPoliciesOperationsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of ObjectReplicationPoliciesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ObjectReplicationPoliciesOperationsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy + .create( + ObjectReplicationPoliciesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientObjectReplicationPoliciesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface ObjectReplicationPoliciesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/objectReplicationPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @BodyParam("application/json") ObjectReplicationPolicyInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + accept, + context); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectReplicationPolicyInner get( + String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return getAsync(resourceGroupName, accountName, objectReplicationPolicyId).block(); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + properties, + accept, + context); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectReplicationPolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties) { + return createOrUpdateAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties).block(); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the replication policy between two storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, objectReplicationPolicyId, properties, context) + .block(); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + objectReplicationPolicyId, + accept, + context); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + deleteAsync(resourceGroupName, accountName, objectReplicationPolicyId).block(); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java new file mode 100644 index 0000000000000..c9535843c2b8c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPoliciesOperations; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; + +public final class ObjectReplicationPoliciesOperationsImpl implements ObjectReplicationPoliciesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPoliciesOperationsImpl.class); + + private final ObjectReplicationPoliciesOperationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public ObjectReplicationPoliciesOperationsImpl( + ObjectReplicationPoliciesOperationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new ObjectReplicationPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new ObjectReplicationPolicyImpl(inner1, this.manager())); + } + + public ObjectReplicationPolicy get(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + ObjectReplicationPolicyInner inner = + this.serviceClient().get(resourceGroupName, accountName, objectReplicationPolicyId); + if (inner != null) { + return new ObjectReplicationPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ObjectReplicationPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + this.serviceClient().delete(resourceGroupName, accountName, objectReplicationPolicyId); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + public ObjectReplicationPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = Utils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", + id))); + } + return this.getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = Utils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", + id))); + } + return this.getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = Utils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", + id))); + } + this.deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = Utils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + private ObjectReplicationPoliciesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public ObjectReplicationPolicyImpl define(String name) { + return new ObjectReplicationPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java new file mode 100644 index 0000000000000..57cb4635bcd6e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ObjectReplicationPolicyImpl + implements ObjectReplicationPolicy, ObjectReplicationPolicy.Definition, ObjectReplicationPolicy.Update { + private ObjectReplicationPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String policyId() { + return this.innerModel().policyId(); + } + + public OffsetDateTime enabledTime() { + return this.innerModel().enabledTime(); + } + + public String sourceAccount() { + return this.innerModel().sourceAccount(); + } + + public String destinationAccount() { + return this.innerModel().destinationAccount(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ObjectReplicationPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String objectReplicationPolicyId; + + public ObjectReplicationPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ObjectReplicationPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse( + resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse( + resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), context) + .getValue(); + return this; + } + + ObjectReplicationPolicyImpl( + String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ObjectReplicationPolicyInner(); + this.serviceManager = serviceManager; + this.objectReplicationPolicyId = name; + } + + public ObjectReplicationPolicyImpl update() { + return this; + } + + public ObjectReplicationPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse( + resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse( + resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), context) + .getValue(); + return this; + } + + ObjectReplicationPolicyImpl( + ObjectReplicationPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.objectReplicationPolicyId = Utils.getValueFromIdByName(innerObject.id(), "objectReplicationPolicies"); + } + + public ObjectReplicationPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getObjectReplicationPoliciesOperations() + .getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context) + .getValue(); + return this; + } + + public ObjectReplicationPolicyImpl withSourceAccount(String sourceAccount) { + this.innerModel().withSourceAccount(sourceAccount); + return this; + } + + public ObjectReplicationPolicyImpl withDestinationAccount(String destinationAccount) { + this.innerModel().withDestinationAccount(destinationAccount); + return this; + } + + public ObjectReplicationPolicyImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..fd0c003c519e3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.models.Operation; +import com.azure.resourcemanager.storage.generated.models.OperationDisplay; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..7d1b39b3c2a45 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Storage/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..42cdfa45b691b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.models.Operation; +import com.azure.resourcemanager.storage.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..023873755d8fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..458bc8e3b3901 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,884 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, accountName, privateEndpointConnectionName).block(); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + properties, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner put( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..8d76d9839ece6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, accountName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..b261db709053d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..d63e084c0c8db --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageAccount( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageAccount( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageAccount( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByStorageAccountAsync( + String resourceGroupName, String accountName) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName) { + return listByStorageAccountAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..8483deb6fd90c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourceListResult listByStorageAccount(String resourceGroupName, String accountName) { + PrivateLinkResourceListResultInner inner = + this.serviceClient().listByStorageAccount(resourceGroupName, accountName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listByStorageAccountWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java new file mode 100644 index 0000000000000..97e551943759a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; + +public final class QueueServicePropertiesImpl + implements QueueServiceProperties, QueueServiceProperties.Definition, QueueServiceProperties.Update { + private QueueServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public QueueServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public QueueServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public QueueServiceProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + QueueServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new QueueServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public QueueServicePropertiesImpl update() { + return this; + } + + public QueueServiceProperties apply() { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + QueueServicePropertiesImpl( + QueueServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public QueueServiceProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueueServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public QueueServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java new file mode 100644 index 0000000000000..e966be7d56f91 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QueueServicesClient. */ +public final class QueueServicesClientImpl implements QueueServicesClient { + /** The proxy service used to perform REST calls. */ + private final QueueServicesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of QueueServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueueServicesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(QueueServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientQueueServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface QueueServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/{queueServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueServiceName") String queueServiceName, + @BodyParam("application/json") QueueServicePropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/{queueServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueServiceName") String queueServiceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListQueueServicesInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueServiceName, + parameters, + accept, + context); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QueueServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { + return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueServiceName, + accept, + context); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java new file mode 100644 index 0000000000000..d599ca8b59ed1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueServices; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; +import com.azure.resourcemanager.storage.generated.models.QueueServices; + +public final class QueueServicesImpl implements QueueServices { + private static final ClientLogger LOGGER = new ClientLogger(QueueServicesImpl.class); + + private final QueueServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public QueueServicesImpl( + QueueServicesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ListQueueServices list(String resourceGroupName, String accountName) { + ListQueueServicesInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new ListQueueServicesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListQueueServicesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QueueServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + QueueServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new QueueServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QueueServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QueueServiceProperties getServicePropertiesById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private QueueServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public QueueServicePropertiesImpl define() { + return new QueueServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java new file mode 100644 index 0000000000000..43225a19706b1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java @@ -0,0 +1,1209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueResource; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QueuesClient. */ +public final class QueuesClientImpl implements QueuesClient { + /** The proxy service used to perform REST calls. */ + private final QueuesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of QueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueuesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(QueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientQueues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface QueuesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, + @BodyParam("application/json") StorageQueueInner queue, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, + @BodyParam("application/json") StorageQueueInner queue, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/queueServices/default/queues") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + queue, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + queue, + accept, + context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return createWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner create( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return createAsync(resourceGroupName, accountName, queueName, queue).block(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + queue, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + queue, + accept, + context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner update( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return updateAsync(resourceGroupName, accountName, queueName, queue).block(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param queue Queue properties and metadata to be created with. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + accept, + context); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String queueName) { + return getWithResponseAsync(resourceGroupName, accountName, queueName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner get(String resourceGroupName, String accountName, String queueName) { + return getAsync(resourceGroupName, accountName, queueName).block(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String queueName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + queueName, + accept, + context); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String queueName) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String queueName) { + deleteAsync(resourceGroupName, accountName, queueName).block(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + maxpagesize, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java new file mode 100644 index 0000000000000..b89ef6bca4691 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueue; +import com.azure.resourcemanager.storage.generated.models.Queues; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +public final class QueuesImpl implements Queues { + private static final ClientLogger LOGGER = new ClientLogger(QueuesImpl.class); + + private final QueuesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public QueuesImpl( + QueuesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public StorageQueue get(String resourceGroupName, String accountName, String queueName) { + StorageQueueInner inner = this.serviceClient().get(resourceGroupName, accountName, queueName); + if (inner != null) { + return new StorageQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, queueName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageQueueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String queueName) { + this.serviceClient().delete(resourceGroupName, accountName, queueName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, queueName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new ListQueueImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, context); + return Utils.mapPage(inner, inner1 -> new ListQueueImpl(inner1, this.manager())); + } + + public StorageQueue getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, queueName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, queueName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, queueName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = Utils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, queueName, context); + } + + private QueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public StorageQueueImpl define(String name) { + return new StorageQueueImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java new file mode 100644 index 0000000000000..c7d6ab438ccae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.Restriction; +import com.azure.resourcemanager.storage.generated.models.SkuCapability; +import com.azure.resourcemanager.storage.generated.models.SkuInformation; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.SkuTier; +import java.util.Collections; +import java.util.List; + +public final class SkuInformationImpl implements SkuInformation { + private SkuInformationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + SkuInformationImpl( + SkuInformationInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SkuName name() { + return this.innerModel().name(); + } + + public SkuTier tier() { + return this.innerModel().tier(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public Kind kind() { + return this.innerModel().kind(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..e22a9e860c250 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.StorageSkuListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java new file mode 100644 index 0000000000000..913fe03de5b2f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.SkuInformation; +import com.azure.resourcemanager.storage.generated.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java new file mode 100644 index 0000000000000..9bbc6c2d7e9b3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java @@ -0,0 +1,730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class StorageAccountImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Kind kind() { + return this.innerModel().kind(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Endpoints primaryEndpoints() { + return this.innerModel().primaryEndpoints(); + } + + public String primaryLocation() { + return this.innerModel().primaryLocation(); + } + + public AccountStatus statusOfPrimary() { + return this.innerModel().statusOfPrimary(); + } + + public OffsetDateTime lastGeoFailoverTime() { + return this.innerModel().lastGeoFailoverTime(); + } + + public String secondaryLocation() { + return this.innerModel().secondaryLocation(); + } + + public AccountStatus statusOfSecondary() { + return this.innerModel().statusOfSecondary(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public CustomDomain customDomain() { + return this.innerModel().customDomain(); + } + + public SasPolicy sasPolicy() { + return this.innerModel().sasPolicy(); + } + + public KeyPolicy keyPolicy() { + return this.innerModel().keyPolicy(); + } + + public KeyCreationTime keyCreationTime() { + return this.innerModel().keyCreationTime(); + } + + public Endpoints secondaryEndpoints() { + return this.innerModel().secondaryEndpoints(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public AccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerModel().azureFilesIdentityBasedAuthentication(); + } + + public Boolean enableHttpsTrafficOnly() { + return this.innerModel().enableHttpsTrafficOnly(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Boolean isSftpEnabled() { + return this.innerModel().isSftpEnabled(); + } + + public Boolean isLocalUserEnabled() { + return this.innerModel().isLocalUserEnabled(); + } + + public Boolean isHnsEnabled() { + return this.innerModel().isHnsEnabled(); + } + + public GeoReplicationStats geoReplicationStats() { + return this.innerModel().geoReplicationStats(); + } + + public Boolean failoverInProgress() { + return this.innerModel().failoverInProgress(); + } + + public LargeFileSharesState largeFileSharesState() { + return this.innerModel().largeFileSharesState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingPreference routingPreference() { + return this.innerModel().routingPreference(); + } + + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.innerModel().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean allowBlobPublicAccess() { + return this.innerModel().allowBlobPublicAccess(); + } + + public MinimumTlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public Boolean allowSharedKeyAccess() { + return this.innerModel().allowSharedKeyAccess(); + } + + public Boolean enableNfsV3() { + return this.innerModel().enableNfsV3(); + } + + public Boolean allowCrossTenantReplication() { + return this.innerModel().allowCrossTenantReplication(); + } + + public Boolean defaultToOAuthAuthentication() { + return this.innerModel().defaultToOAuthAuthentication(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public AllowedCopyScope allowedCopyScope() { + return this.innerModel().allowedCopyScope(); + } + + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerModel().storageAccountSkuConversionStatus(); + } + + public DnsEndpointType dnsEndpointType() { + return this.innerModel().dnsEndpointType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private StorageAccountCreateParameters createParameters; + + private StorageAccountUpdateParameters updateParameters; + + public StorageAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageAccount create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .create(resourceGroupName, accountName, createParameters, Context.NONE); + return this; + } + + public StorageAccount create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .create(resourceGroupName, accountName, createParameters, context); + return this; + } + + StorageAccountImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new StorageAccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + this.createParameters = new StorageAccountCreateParameters(); + } + + public StorageAccountImpl update() { + this.updateParameters = new StorageAccountUpdateParameters(); + return this; + } + + public StorageAccount apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public StorageAccount apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, context) + .getValue(); + return this; + } + + StorageAccountImpl( + StorageAccountInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public StorageAccount refresh() { + StorageAccountExpand localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public StorageAccount refresh(Context context) { + StorageAccountExpand localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, context) + .getValue(); + return this; + } + + public StorageAccountListKeysResult listKeys() { + return serviceManager.storageAccounts().listKeys(resourceGroupName, accountName); + } + + public Response listKeysWithResponse(ListKeyExpand expand, Context context) { + return serviceManager.storageAccounts().listKeysWithResponse(resourceGroupName, accountName, expand, context); + } + + public StorageAccountListKeysResult regenerateKey(StorageAccountRegenerateKeyParameters regenerateKey) { + return serviceManager.storageAccounts().regenerateKey(resourceGroupName, accountName, regenerateKey); + } + + public Response regenerateKeyWithResponse( + StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + return serviceManager + .storageAccounts() + .regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, context); + } + + public ListAccountSasResponse listAccountSas(AccountSasParameters parameters) { + return serviceManager.storageAccounts().listAccountSas(resourceGroupName, accountName, parameters); + } + + public Response listAccountSasWithResponse( + AccountSasParameters parameters, Context context) { + return serviceManager + .storageAccounts() + .listAccountSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public ListServiceSasResponse listServiceSas(ServiceSasParameters parameters) { + return serviceManager.storageAccounts().listServiceSas(resourceGroupName, accountName, parameters); + } + + public Response listServiceSasWithResponse( + ServiceSasParameters parameters, Context context) { + return serviceManager + .storageAccounts() + .listServiceSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public void failover() { + serviceManager.storageAccounts().failover(resourceGroupName, accountName); + } + + public void failover(Context context) { + serviceManager.storageAccounts().failover(resourceGroupName, accountName, context); + } + + public BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters) { + return serviceManager.storageAccounts().restoreBlobRanges(resourceGroupName, accountName, parameters); + } + + public BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters, Context context) { + return serviceManager.storageAccounts().restoreBlobRanges(resourceGroupName, accountName, parameters, context); + } + + public void revokeUserDelegationKeys() { + serviceManager.storageAccounts().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public Response revokeUserDelegationKeysWithResponse(Context context) { + return serviceManager + .storageAccounts() + .revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + public StorageAccountImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public StorageAccountImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public StorageAccountImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameters.withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public StorageAccountImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.createParameters.withKind(kind); + return this; + } else { + this.updateParameters.withKind(kind); + return this; + } + } + + public StorageAccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public StorageAccountImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.createParameters.withExtendedLocation(extendedLocation); + return this; + } + + public StorageAccountImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.createParameters.withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public StorageAccountImpl withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (isInCreateMode()) { + this.createParameters.withAllowedCopyScope(allowedCopyScope); + return this; + } else { + this.updateParameters.withAllowedCopyScope(allowedCopyScope); + return this; + } + } + + public StorageAccountImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.createParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public StorageAccountImpl withSasPolicy(SasPolicy sasPolicy) { + if (isInCreateMode()) { + this.createParameters.withSasPolicy(sasPolicy); + return this; + } else { + this.updateParameters.withSasPolicy(sasPolicy); + return this; + } + } + + public StorageAccountImpl withKeyPolicy(KeyPolicy keyPolicy) { + if (isInCreateMode()) { + this.createParameters.withKeyPolicy(keyPolicy); + return this; + } else { + this.updateParameters.withKeyPolicy(keyPolicy); + return this; + } + } + + public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { + if (isInCreateMode()) { + this.createParameters.withCustomDomain(customDomain); + return this; + } else { + this.updateParameters.withCustomDomain(customDomain); + return this; + } + } + + public StorageAccountImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.createParameters.withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.createParameters.withNetworkRuleSet(networkRuleSet); + return this; + } else { + this.updateParameters.withNetworkRuleSet(networkRuleSet); + return this; + } + } + + public StorageAccountImpl withAccessTier(AccessTier accessTier) { + if (isInCreateMode()) { + this.createParameters.withAccessTier(accessTier); + return this; + } else { + this.updateParameters.withAccessTier(accessTier); + return this; + } + } + + public StorageAccountImpl withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (isInCreateMode()) { + this.createParameters.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } else { + this.updateParameters.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + } + + public StorageAccountImpl withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (isInCreateMode()) { + this.createParameters.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } else { + this.updateParameters.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + } + + public StorageAccountImpl withIsSftpEnabled(Boolean isSftpEnabled) { + if (isInCreateMode()) { + this.createParameters.withIsSftpEnabled(isSftpEnabled); + return this; + } else { + this.updateParameters.withIsSftpEnabled(isSftpEnabled); + return this; + } + } + + public StorageAccountImpl withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (isInCreateMode()) { + this.createParameters.withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } else { + this.updateParameters.withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + } + + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameters.withIsHnsEnabled(isHnsEnabled); + return this; + } + + public StorageAccountImpl withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (isInCreateMode()) { + this.createParameters.withLargeFileSharesState(largeFileSharesState); + return this; + } else { + this.updateParameters.withLargeFileSharesState(largeFileSharesState); + return this; + } + } + + public StorageAccountImpl withRoutingPreference(RoutingPreference routingPreference) { + if (isInCreateMode()) { + this.createParameters.withRoutingPreference(routingPreference); + return this; + } else { + this.updateParameters.withRoutingPreference(routingPreference); + return this; + } + } + + public StorageAccountImpl withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (isInCreateMode()) { + this.createParameters.withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } else { + this.updateParameters.withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + } + + public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } else { + this.updateParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + } + + public StorageAccountImpl withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (isInCreateMode()) { + this.createParameters.withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } else { + this.updateParameters.withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + } + + public StorageAccountImpl withEnableNfsV3(Boolean enableNfsV3) { + this.createParameters.withEnableNfsV3(enableNfsV3); + return this; + } + + public StorageAccountImpl withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (isInCreateMode()) { + this.createParameters.withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } else { + this.updateParameters.withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + } + + public StorageAccountImpl withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (isInCreateMode()) { + this.createParameters.withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } else { + this.updateParameters.withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + } + + public StorageAccountImpl withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + if (isInCreateMode()) { + this.createParameters.withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } else { + this.updateParameters.withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + } + + public StorageAccountImpl withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (isInCreateMode()) { + this.createParameters.withDnsEndpointType(dnsEndpointType); + return this; + } else { + this.updateParameters.withDnsEndpointType(dnsEndpointType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java new file mode 100644 index 0000000000000..79bb96317f120 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.models.StorageAccountKey; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import java.util.Collections; +import java.util.List; + +public final class StorageAccountListKeysResultImpl implements StorageAccountListKeysResult { + private StorageAccountListKeysResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageAccountListKeysResultImpl( + StorageAccountListKeysResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List keys() { + List inner = this.innerModel().keys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageAccountListKeysResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java new file mode 100644 index 0000000000000..2495008d5b98d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.StorageAccountProperties; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class StorageAccountPropertiesImpl implements StorageAccountProperties { + private StorageAccountPropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageAccountPropertiesImpl( + StorageAccountPropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Endpoints primaryEndpoints() { + return this.innerModel().primaryEndpoints(); + } + + public String primaryLocation() { + return this.innerModel().primaryLocation(); + } + + public AccountStatus statusOfPrimary() { + return this.innerModel().statusOfPrimary(); + } + + public OffsetDateTime lastGeoFailoverTime() { + return this.innerModel().lastGeoFailoverTime(); + } + + public String secondaryLocation() { + return this.innerModel().secondaryLocation(); + } + + public AccountStatus statusOfSecondary() { + return this.innerModel().statusOfSecondary(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public CustomDomain customDomain() { + return this.innerModel().customDomain(); + } + + public SasPolicy sasPolicy() { + return this.innerModel().sasPolicy(); + } + + public KeyPolicy keyPolicy() { + return this.innerModel().keyPolicy(); + } + + public KeyCreationTime keyCreationTime() { + return this.innerModel().keyCreationTime(); + } + + public Endpoints secondaryEndpoints() { + return this.innerModel().secondaryEndpoints(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public AccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerModel().azureFilesIdentityBasedAuthentication(); + } + + public Boolean enableHttpsTrafficOnly() { + return this.innerModel().enableHttpsTrafficOnly(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Boolean isSftpEnabled() { + return this.innerModel().isSftpEnabled(); + } + + public Boolean isLocalUserEnabled() { + return this.innerModel().isLocalUserEnabled(); + } + + public Boolean isHnsEnabled() { + return this.innerModel().isHnsEnabled(); + } + + public GeoReplicationStats geoReplicationStats() { + return this.innerModel().geoReplicationStats(); + } + + public Boolean failoverInProgress() { + return this.innerModel().failoverInProgress(); + } + + public LargeFileSharesState largeFileSharesState() { + return this.innerModel().largeFileSharesState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingPreference routingPreference() { + return this.innerModel().routingPreference(); + } + + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.innerModel().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean allowBlobPublicAccess() { + return this.innerModel().allowBlobPublicAccess(); + } + + public MinimumTlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public Boolean allowSharedKeyAccess() { + return this.innerModel().allowSharedKeyAccess(); + } + + public Boolean enableNfsV3() { + return this.innerModel().enableNfsV3(); + } + + public Boolean allowCrossTenantReplication() { + return this.innerModel().allowCrossTenantReplication(); + } + + public Boolean defaultToOAuthAuthentication() { + return this.innerModel().defaultToOAuthAuthentication(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public AllowedCopyScope allowedCopyScope() { + return this.innerModel().allowedCopyScope(); + } + + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerModel().storageAccountSkuConversionStatus(); + } + + public DnsEndpointType dnsEndpointType() { + return this.innerModel().dnsEndpointType(); + } + + public StorageAccountPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java new file mode 100644 index 0000000000000..41cd49b31fce2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java @@ -0,0 +1,3756 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public final class StorageAccountsClientImpl implements StorageAccountsClient { + /** The proxy service used to perform REST calls. */ + private final StorageAccountsService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAccountsClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(StorageAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientStorageAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface StorageAccountsService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountCheckNameAvailabilityParameters accountName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") StorageAccountExpand expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ListKeyExpand expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/regenerateKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKey( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountRegenerateKeyParameters regenerateKey, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/ListAccountSas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAccountSas( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AccountSasParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/ListServiceSas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listServiceSas( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceSasParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/failover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/hnsonmigration") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> hierarchicalNamespaceMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("requestType") String requestType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/aborthnsonmigration") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> abortHierarchicalNamespaceMigration( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/restoreBlobRanges") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restoreBlobRanges( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobRestoreParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/revokeUserDelegationKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> revokeUserDelegationKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + StorageAccountCheckNameAvailabilityParameters accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } else { + accountName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accountName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } else { + accountName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accountName, + accept, + context); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + StorageAccountCheckNameAvailabilityParameters accountName) { + return checkNameAvailabilityWithResponseAsync(accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + StorageAccountCheckNameAvailabilityParameters accountName) { + return checkNameAvailabilityAsync(accountName).block(); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + return checkNameAvailabilityWithResponseAsync(accountName, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageAccountInner> beginCreateAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageAccountInner.class, + StorageAccountInner.class, + this.client.getContext()); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageAccountInner> beginCreateAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), StorageAccountInner.class, StorageAccountInner.class, context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + return beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, accountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + return beginCreateAsync(resourceGroupName, accountName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner create( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return createAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner create( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + return createAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountExpand expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + final StorageAccountExpand expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + final StorageAccountExpand expand = null; + return getByResourceGroupAsync(resourceGroupName, accountName, expand).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner update( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String accountName, ListKeyExpand expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + expand, + accept, + context); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String accountName) { + final ListKeyExpand expand = null; + return listKeysWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + final ListKeyExpand expand = null; + return listKeysAsync(resourceGroupName, accountName, expand).block(); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, expand, context).block(); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (regenerateKey == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); + } else { + regenerateKey.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + regenerateKey, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (regenerateKey == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); + } else { + regenerateKey.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + regenerateKey, + accept, + context); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountListKeysResultInner regenerateKey( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + return regenerateKeyAsync(resourceGroupName, accountName, regenerateKey).block(); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey, context).block(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAccountSasWithResponseAsync( + String resourceGroupName, String accountName, AccountSasParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAccountSas( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAccountSasWithResponseAsync( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAccountSas( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAccountSasAsync( + String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListAccountSasResponseInner listAccountSas( + String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSasAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { + return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceSasWithResponseAsync( + String resourceGroupName, String accountName, ServiceSasParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listServiceSas( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceSasWithResponseAsync( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listServiceSas( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listServiceSasAsync( + String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListServiceSasResponseInner listServiceSas( + String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSasAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .failover( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .failover( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String accountName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverAsync( + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover(String resourceGroupName, String accountName) { + return beginFailoverAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailover( + String resourceGroupName, String accountName, Context context) { + return beginFailoverAsync(resourceGroupName, accountName, context).getSyncPoller(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String accountName) { + return beginFailoverAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String accountName, Context context) { + return beginFailoverAsync(resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String accountName) { + failoverAsync(resourceGroupName, accountName).block(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void failover(String resourceGroupName, String accountName, Context context) { + failoverAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hierarchicalNamespaceMigrationWithResponseAsync( + String resourceGroupName, String accountName, String requestType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (requestType == null) { + return Mono.error(new IllegalArgumentException("Parameter requestType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .hierarchicalNamespaceMigration( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + requestType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hierarchicalNamespaceMigrationWithResponseAsync( + String resourceGroupName, String accountName, String requestType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (requestType == null) { + return Mono.error(new IllegalArgumentException("Parameter requestType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .hierarchicalNamespaceMigration( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + requestType, + accept, + context); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, String requestType) { + Mono>> mono = + hierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, requestType); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, String requestType, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + hierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, requestType, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType).getSyncPoller(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context) + .getSyncPoller(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, String requestType) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, String requestType, Context context) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType) { + hierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType).block(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context) { + hierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context).block(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> abortHierarchicalNamespaceMigrationWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .abortHierarchicalNamespaceMigration( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> abortHierarchicalNamespaceMigrationWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .abortHierarchicalNamespaceMigration( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAbortHierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName) { + Mono>> mono = + abortHierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginAbortHierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + abortHierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortHierarchicalNamespaceMigration( + String resourceGroupName, String accountName) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAbortHierarchicalNamespaceMigration( + String resourceGroupName, String accountName, Context context) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context).getSyncPoller(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortHierarchicalNamespaceMigrationAsync(String resourceGroupName, String accountName) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortHierarchicalNamespaceMigrationAsync( + String resourceGroupName, String accountName, Context context) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName) { + abortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName).block(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context) { + abortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreBlobRangesWithResponseAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restoreBlobRanges( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreBlobRangesWithResponseAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restoreBlobRanges( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + Mono>> mono = + restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BlobRestoreStatusInner.class, + BlobRestoreStatusInner.class, + this.client.getContext()); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BlobRestoreStatusInner.class, + BlobRestoreStatusInner.class, + context); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreBlobRangesAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreBlobRangesAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobRestoreStatusInner restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + return restoreBlobRangesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobRestoreStatusInner restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + return restoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revokeUserDelegationKeysWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .revokeUserDelegationKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> revokeUserDelegationKeysWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .revokeUserDelegationKeys( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revokeUserDelegationKeys(String resourceGroupName, String accountName) { + revokeUserDelegationKeysAsync(resourceGroupName, accountName).block(); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response revokeUserDelegationKeysWithResponse( + String resourceGroupName, String accountName, Context context) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..4371dc285d692 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccounts; + +public final class StorageAccountsImpl implements StorageAccounts { + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountsImpl.class); + + private final StorageAccountsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public StorageAccountsImpl( + StorageAccountsClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResult checkNameAvailability( + StorageAccountCheckNameAvailabilityParameters accountName) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(accountName); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public StorageAccount getByResourceGroup(String resourceGroupName, String accountName) { + StorageAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new StorageAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public StorageAccountListKeysResult listKeys(String resourceGroupName, String accountName) { + StorageAccountListKeysResultInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); + if (inner != null) { + return new StorageAccountListKeysResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountListKeysResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAccountListKeysResult regenerateKey( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + StorageAccountListKeysResultInner inner = + this.serviceClient().regenerateKey(resourceGroupName, accountName, regenerateKey); + if (inner != null) { + return new StorageAccountListKeysResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context) { + Response inner = + this.serviceClient().regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountListKeysResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListAccountSasResponse listAccountSas( + String resourceGroupName, String accountName, AccountSasParameters parameters) { + ListAccountSasResponseInner inner = + this.serviceClient().listAccountSas(resourceGroupName, accountName, parameters); + if (inner != null) { + return new ListAccountSasResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { + Response inner = + this.serviceClient().listAccountSasWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListAccountSasResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListServiceSasResponse listServiceSas( + String resourceGroupName, String accountName, ServiceSasParameters parameters) { + ListServiceSasResponseInner inner = + this.serviceClient().listServiceSas(resourceGroupName, accountName, parameters); + if (inner != null) { + return new ListServiceSasResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { + Response inner = + this.serviceClient().listServiceSasWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListServiceSasResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void failover(String resourceGroupName, String accountName) { + this.serviceClient().failover(resourceGroupName, accountName); + } + + public void failover(String resourceGroupName, String accountName, Context context) { + this.serviceClient().failover(resourceGroupName, accountName, context); + } + + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType) { + this.serviceClient().hierarchicalNamespaceMigration(resourceGroupName, accountName, requestType); + } + + public void hierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context) { + this.serviceClient().hierarchicalNamespaceMigration(resourceGroupName, accountName, requestType, context); + } + + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName) { + this.serviceClient().abortHierarchicalNamespaceMigration(resourceGroupName, accountName); + } + + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context) { + this.serviceClient().abortHierarchicalNamespaceMigration(resourceGroupName, accountName, context); + } + + public BlobRestoreStatus restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + BlobRestoreStatusInner inner = + this.serviceClient().restoreBlobRanges(resourceGroupName, accountName, parameters); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BlobRestoreStatus restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + BlobRestoreStatusInner inner = + this.serviceClient().restoreBlobRanges(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public void revokeUserDelegationKeys(String resourceGroupName, String accountName) { + this.serviceClient().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public Response revokeUserDelegationKeysWithResponse( + String resourceGroupName, String accountName, Context context) { + return this.serviceClient().revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + public StorageAccount getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + StorageAccountExpand localExpand = null; + return this + .getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, StorageAccountExpand expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, context); + } + + private StorageAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public StorageAccountImpl define(String name) { + return new StorageAccountImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java new file mode 100644 index 0000000000000..3c2fe4b77f20c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the StorageManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {StorageManagementClientImpl.class}) +public final class StorageManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of StorageManagementClientImpl with the provided parameters. + * + * @return an instance of StorageManagementClientImpl. + */ + public StorageManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + StorageManagementClientImpl client = + new StorageManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java new file mode 100644 index 0000000000000..b6827ddd5be61 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageManagementClient; +import com.azure.resourcemanager.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.UsagesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the StorageManagementClientImpl type. */ +@ServiceClient(builder = StorageManagementClientBuilder.class) +public final class StorageManagementClientImpl implements StorageManagementClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The StorageAccountsClient object to access its operations. */ + private final StorageAccountsClient storageAccounts; + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + public StorageAccountsClient getStorageAccounts() { + return this.storageAccounts; + } + + /** The DeletedAccountsClient object to access its operations. */ + private final DeletedAccountsClient deletedAccounts; + + /** + * Gets the DeletedAccountsClient object to access its operations. + * + * @return the DeletedAccountsClient object. + */ + public DeletedAccountsClient getDeletedAccounts() { + return this.deletedAccounts; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The ManagementPoliciesClient object to access its operations. */ + private final ManagementPoliciesClient managementPolicies; + + /** + * Gets the ManagementPoliciesClient object to access its operations. + * + * @return the ManagementPoliciesClient object. + */ + public ManagementPoliciesClient getManagementPolicies() { + return this.managementPolicies; + } + + /** The BlobInventoryPoliciesClient object to access its operations. */ + private final BlobInventoryPoliciesClient blobInventoryPolicies; + + /** + * Gets the BlobInventoryPoliciesClient object to access its operations. + * + * @return the BlobInventoryPoliciesClient object. + */ + public BlobInventoryPoliciesClient getBlobInventoryPolicies() { + return this.blobInventoryPolicies; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The ObjectReplicationPoliciesOperationsClient object to access its operations. */ + private final ObjectReplicationPoliciesOperationsClient objectReplicationPoliciesOperations; + + /** + * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. + * + * @return the ObjectReplicationPoliciesOperationsClient object. + */ + public ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations() { + return this.objectReplicationPoliciesOperations; + } + + /** The LocalUsersOperationsClient object to access its operations. */ + private final LocalUsersOperationsClient localUsersOperations; + + /** + * Gets the LocalUsersOperationsClient object to access its operations. + * + * @return the LocalUsersOperationsClient object. + */ + public LocalUsersOperationsClient getLocalUsersOperations() { + return this.localUsersOperations; + } + + /** The EncryptionScopesClient object to access its operations. */ + private final EncryptionScopesClient encryptionScopes; + + /** + * Gets the EncryptionScopesClient object to access its operations. + * + * @return the EncryptionScopesClient object. + */ + public EncryptionScopesClient getEncryptionScopes() { + return this.encryptionScopes; + } + + /** The BlobServicesClient object to access its operations. */ + private final BlobServicesClient blobServices; + + /** + * Gets the BlobServicesClient object to access its operations. + * + * @return the BlobServicesClient object. + */ + public BlobServicesClient getBlobServices() { + return this.blobServices; + } + + /** The BlobContainersClient object to access its operations. */ + private final BlobContainersClient blobContainers; + + /** + * Gets the BlobContainersClient object to access its operations. + * + * @return the BlobContainersClient object. + */ + public BlobContainersClient getBlobContainers() { + return this.blobContainers; + } + + /** The FileServicesClient object to access its operations. */ + private final FileServicesClient fileServices; + + /** + * Gets the FileServicesClient object to access its operations. + * + * @return the FileServicesClient object. + */ + public FileServicesClient getFileServices() { + return this.fileServices; + } + + /** The FileSharesClient object to access its operations. */ + private final FileSharesClient fileShares; + + /** + * Gets the FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + public FileSharesClient getFileShares() { + return this.fileShares; + } + + /** The QueueServicesClient object to access its operations. */ + private final QueueServicesClient queueServices; + + /** + * Gets the QueueServicesClient object to access its operations. + * + * @return the QueueServicesClient object. + */ + public QueueServicesClient getQueueServices() { + return this.queueServices; + } + + /** The QueuesClient object to access its operations. */ + private final QueuesClient queues; + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + public QueuesClient getQueues() { + return this.queues; + } + + /** The TableServicesClient object to access its operations. */ + private final TableServicesClient tableServices; + + /** + * Gets the TableServicesClient object to access its operations. + * + * @return the TableServicesClient object. + */ + public TableServicesClient getTableServices() { + return this.tableServices; + } + + /** The TablesClient object to access its operations. */ + private final TablesClient tables; + + /** + * Gets the TablesClient object to access its operations. + * + * @return the TablesClient object. + */ + public TablesClient getTables() { + return this.tables; + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + StorageManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-05-01"; + this.operations = new OperationsClientImpl(this); + this.skus = new SkusClientImpl(this); + this.storageAccounts = new StorageAccountsClientImpl(this); + this.deletedAccounts = new DeletedAccountsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.managementPolicies = new ManagementPoliciesClientImpl(this); + this.blobInventoryPolicies = new BlobInventoryPoliciesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsClientImpl(this); + this.localUsersOperations = new LocalUsersOperationsClientImpl(this); + this.encryptionScopes = new EncryptionScopesClientImpl(this); + this.blobServices = new BlobServicesClientImpl(this); + this.blobContainers = new BlobContainersClientImpl(this); + this.fileServices = new FileServicesClientImpl(this); + this.fileShares = new FileSharesClientImpl(this); + this.queueServices = new QueueServicesClientImpl(this); + this.queues = new QueuesClientImpl(this); + this.tableServices = new TableServicesClientImpl(this); + this.tables = new TablesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageManagementClientImpl.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java new file mode 100644 index 0000000000000..2c1827da67de7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; +import java.util.Collections; +import java.util.Map; + +public final class StorageQueueImpl implements StorageQueue, StorageQueue.Definition, StorageQueue.Update { + private StorageQueueInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer approximateMessageCount() { + return this.innerModel().approximateMessageCount(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String queueName; + + public StorageQueueImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StorageQueue create() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StorageQueue create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .createWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + StorageQueueImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new StorageQueueInner(); + this.serviceManager = serviceManager; + this.queueName = name; + } + + public StorageQueueImpl update() { + return this; + } + + public StorageQueue apply() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .updateWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StorageQueue apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .updateWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + StorageQueueImpl( + StorageQueueInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.queueName = Utils.getValueFromIdByName(innerObject.id(), "queues"); + } + + public StorageQueue refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, accountName, queueName, Context.NONE) + .getValue(); + return this; + } + + public StorageQueue refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, accountName, queueName, context) + .getValue(); + return this; + } + + public StorageQueueImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java new file mode 100644 index 0000000000000..8726d785e3dc6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.util.Collections; +import java.util.List; + +public final class TableImpl implements Table, Table.Definition, Table.Update { + private TableInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String tableName() { + return this.innerModel().tableName(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String tableName; + + public TableImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Table create() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .createWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .createWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new TableInner(); + this.serviceManager = serviceManager; + this.tableName = name; + } + + public TableImpl update() { + return this; + } + + public Table apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(TableInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.tableName = Utils.getValueFromIdByName(innerObject.id(), "tables"); + } + + public Table refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .getWithResponse(resourceGroupName, accountName, tableName, Context.NONE) + .getValue(); + return this; + } + + public Table refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTables() + .getWithResponse(resourceGroupName, accountName, tableName, context) + .getValue(); + return this; + } + + public TableImpl withSignedIdentifiers(List signedIdentifiers) { + this.innerModel().withSignedIdentifiers(signedIdentifiers); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java new file mode 100644 index 0000000000000..d0d8486387529 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; + +public final class TableServicePropertiesImpl + implements TableServiceProperties, TableServiceProperties.Definition, TableServiceProperties.Update { + private TableServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TableServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public TableServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public TableServiceProperties create() { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + TableServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new TableServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public TableServicePropertiesImpl update() { + return this; + } + + public TableServiceProperties apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + TableServicePropertiesImpl( + TableServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public TableServiceProperties refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTableServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public TableServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java new file mode 100644 index 0000000000000..1f3efdb687dd1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TableServicesClient. */ +public final class TableServicesClientImpl implements TableServicesClient { + /** The proxy service used to perform REST calls. */ + private final TableServicesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of TableServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TableServicesClientImpl(StorageManagementClientImpl client) { + this.service = + RestProxy.create(TableServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientTableServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface TableServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/{tableServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableServiceName") String tableServiceName, + @BodyParam("application/json") TableServicePropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/{tableServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableServiceName") String tableServiceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListTableServicesInner list(String resourceGroupName, String accountName) { + return listAsync(resourceGroupName, accountName).block(); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableServiceName, + parameters, + accept, + context); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableServicePropertiesInner setServiceProperties( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { + return setServicePropertiesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getServiceProperties( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableServiceName, + accept, + context); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java new file mode 100644 index 0000000000000..294631aef6664 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListTableServices; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; +import com.azure.resourcemanager.storage.generated.models.TableServices; + +public final class TableServicesImpl implements TableServices { + private static final ClientLogger LOGGER = new ClientLogger(TableServicesImpl.class); + + private final TableServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public TableServicesImpl( + TableServicesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ListTableServices list(String resourceGroupName, String accountName) { + ListTableServicesInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new ListTableServicesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ListTableServicesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TableServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + TableServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new TableServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TableServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TableServiceProperties getServicePropertiesById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private TableServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public TableServicePropertiesImpl define() { + return new TableServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java new file mode 100644 index 0000000000000..625b04522d904 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.ListTableResource; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TablesClient. */ +public final class TablesClientImpl implements TablesClient { + /** The proxy service used to perform REST calls. */ + private final TablesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of TablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TablesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(TablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientTables to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface TablesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, + @BodyParam("application/json") TableInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, + @BodyParam("application/json") TableInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage" + + "/storageAccounts/{accountName}/tableServices/default/tables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + parameters, + accept, + context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters) { + return createWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return createWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner create(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return createAsync(resourceGroupName, accountName, tableName, parameters).block(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, tableName, parameters, context).block(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + parameters, + accept, + context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String tableName, TableInner parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner update(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return updateAsync(resourceGroupName, accountName, tableName, parameters).block(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param parameters The parameters to provide to create a table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String accountName, String tableName, TableInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, tableName, parameters, context).block(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String tableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String tableName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + accept, + context); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String tableName) { + return getWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner get(String resourceGroupName, String accountName, String tableName) { + return getAsync(resourceGroupName, accountName, tableName).block(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String tableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String tableName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + accept, + context); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String tableName) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String tableName) { + deleteAsync(resourceGroupName, accountName, tableName).block(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java new file mode 100644 index 0000000000000..a2c47f68e3600 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.Tables; + +public final class TablesImpl implements Tables { + private static final ClientLogger LOGGER = new ClientLogger(TablesImpl.class); + + private final TablesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public TablesImpl( + TablesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Table get(String resourceGroupName, String accountName, String tableName) { + TableInner inner = this.serviceClient().get(resourceGroupName, accountName, tableName); + if (inner != null) { + return new TableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, tableName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String tableName) { + this.serviceClient().delete(resourceGroupName, accountName, tableName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, tableName, context); + } + + public PagedIterable
list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); + } + + public PagedIterable
list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); + } + + public Table getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); + } + + public Response
getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, tableName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, tableName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, tableName, context); + } + + private TablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public TableImpl define(String name) { + return new TableImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..23e69aa9396cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.Usage; +import com.azure.resourcemanager.storage.generated.models.UsageName; +import com.azure.resourcemanager.storage.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..446540bb34de4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.UsagesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.UsageListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, context)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..08b1b296770d0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.UsagesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.Usage; +import com.azure.resourcemanager.storage.generated.models.Usages; + +public final class UsagesImpl implements Usages { + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.java new file mode 100644 index 0000000000000..e9456b247b1f4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java new file mode 100644 index 0000000000000..bc02703abe68e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for StorageManagementClient. The Azure Storage Management API. */ +package com.azure.resourcemanager.storage.generated.implementation; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java new file mode 100644 index 0000000000000..9d8e1b6037566 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The AccessPolicy model. */ +@Fluent +public final class AccessPolicy { + /* + * Start time of the access policy + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Expiry time of the access policy + */ + @JsonProperty(value = "expiryTime") + private OffsetDateTime expiryTime; + + /* + * List of abbreviated permissions. + */ + @JsonProperty(value = "permission") + private String permission; + + /** + * Get the startTime property: Start time of the access policy. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the access policy. + * + * @param startTime the startTime value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the expiryTime property: Expiry time of the access policy. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: Expiry time of the access policy. + * + * @param expiryTime the expiryTime value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the permission property: List of abbreviated permissions. + * + * @return the permission value. + */ + public String permission() { + return this.permission; + } + + /** + * Set the permission property: List of abbreviated permissions. + * + * @param permission the permission value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withPermission(String permission) { + this.permission = permission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java new file mode 100644 index 0000000000000..37050e0569b8d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AccessTier. */ +public enum AccessTier { + /** Enum value Hot. */ + HOT("Hot"), + + /** Enum value Cool. */ + COOL("Cool"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a AccessTier instance. */ + private final String value; + + AccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessTier object, or null if unable to parse. + */ + @JsonCreator + public static AccessTier fromString(String value) { + if (value == null) { + return null; + } + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..b294a49b19f20 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This defines account-level immutability policy properties. */ +@Fluent +public final class AccountImmutabilityPolicyProperties { + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays") + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * 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. + */ + @JsonProperty(value = "state") + private AccountImmutabilityPolicyState state; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays( + Integer immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the state property: 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. + * + * @return the state value. + */ + public AccountImmutabilityPolicyState state() { + return this.state; + } + + /** + * Set the state property: 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. + * + * @param state the state value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties withState(AccountImmutabilityPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: 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. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java new file mode 100644 index 0000000000000..69b9319f73c38 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccountImmutabilityPolicyState. */ +public final class AccountImmutabilityPolicyState extends ExpandableStringEnum { + /** Static value Unlocked for AccountImmutabilityPolicyState. */ + public static final AccountImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** Static value Locked for AccountImmutabilityPolicyState. */ + public static final AccountImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** Static value Disabled for AccountImmutabilityPolicyState. */ + public static final AccountImmutabilityPolicyState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a AccountImmutabilityPolicyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountImmutabilityPolicyState. + */ + @JsonCreator + public static AccountImmutabilityPolicyState fromString(String name) { + return fromString(name, AccountImmutabilityPolicyState.class); + } + + /** + * Gets known AccountImmutabilityPolicyState values. + * + * @return known AccountImmutabilityPolicyState values. + */ + public static Collection values() { + return values(AccountImmutabilityPolicyState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java new file mode 100644 index 0000000000000..a0946477b104c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters to list SAS credentials of a storage account. */ +@Fluent +public final class AccountSasParameters { + /* + * The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), + * File (f). + */ + @JsonProperty(value = "signedServices", required = true) + private Services services; + + /* + * 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. + */ + @JsonProperty(value = "signedResourceTypes", required = true) + private SignedResourceTypes resourceTypes; + + /* + * 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). + */ + @JsonProperty(value = "signedPermission", required = true) + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry", required = true) + private OffsetDateTime sharedAccessExpiryTime; + + /* + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * Get the services property: The signed services accessible with the account SAS. Possible values include: Blob + * (b), Queue (q), Table (t), File (f). + * + * @return the services value. + */ + public Services services() { + return this.services; + } + + /** + * Set the services property: The signed services accessible with the account SAS. Possible values include: Blob + * (b), Queue (q), Table (t), File (f). + * + * @param services the services value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withServices(Services services) { + this.services = services; + return this; + } + + /** + * Get the resourceTypes property: 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. + * + * @return the resourceTypes value. + */ + public SignedResourceTypes resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: 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. + * + * @param resourceTypes the resourceTypes value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the permissions property: 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). + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: 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). + * + * @param permissions the permissions value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the protocols property: The protocol permitted for a request made with the account SAS. + * + * @return the protocols value. + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocols property: The protocol permitted for a request made with the account SAS. + * + * @param protocols the protocols value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value. + */ + public OffsetDateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value. + */ + public OffsetDateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the keyToSign property: The key to sign the account SAS token with. + * + * @return the keyToSign value. + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the keyToSign property: The key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (services() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property services in model AccountSasParameters")); + } + if (resourceTypes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceTypes in model AccountSasParameters")); + } + if (permissions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property permissions in model AccountSasParameters")); + } + if (sharedAccessExpiryTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sharedAccessExpiryTime in model AccountSasParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountSasParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java new file mode 100644 index 0000000000000..035f471deca89 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AccountStatus. */ +public enum AccountStatus { + /** Enum value available. */ + AVAILABLE("available"), + + /** Enum value unavailable. */ + UNAVAILABLE("unavailable"); + + /** The actual serialized value for a AccountStatus instance. */ + private final String value; + + AccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static AccountStatus fromString(String value) { + if (value == null) { + return null; + } + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java new file mode 100644 index 0000000000000..619fbdb91c80a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccountType. */ +public final class AccountType extends ExpandableStringEnum { + /** Static value User for AccountType. */ + public static final AccountType USER = fromString("User"); + + /** Static value Computer for AccountType. */ + public static final AccountType COMPUTER = fromString("Computer"); + + /** + * Creates or finds a AccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountType. + */ + @JsonCreator + public static AccountType fromString(String name) { + return fromString(name, AccountType.class); + } + + /** + * Gets known AccountType values. + * + * @return known AccountType values. + */ + public static Collection values() { + return values(AccountType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java new file mode 100644 index 0000000000000..831e76e56f16b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Action. */ +public enum Action { + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a Action instance. */ + private final String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + @JsonCreator + public static Action fromString(String value) { + if (value == null) { + return null; + } + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java new file mode 100644 index 0000000000000..5e4b9a2985079 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings properties for Active Directory (AD). */ +@Fluent +public final class ActiveDirectoryProperties { + /* + * Specifies the primary domain that the AD DNS server is authoritative for. + */ + @JsonProperty(value = "domainName", required = true) + private String domainName; + + /* + * Specifies the NetBIOS domain name. + */ + @JsonProperty(value = "netBiosDomainName") + private String netBiosDomainName; + + /* + * Specifies the Active Directory forest to get. + */ + @JsonProperty(value = "forestName") + private String forestName; + + /* + * Specifies the domain GUID. + */ + @JsonProperty(value = "domainGuid", required = true) + private String domainGuid; + + /* + * Specifies the security identifier (SID). + */ + @JsonProperty(value = "domainSid") + private String domainSid; + + /* + * Specifies the security identifier (SID) for Azure Storage. + */ + @JsonProperty(value = "azureStorageSid") + private String azureStorageSid; + + /* + * Specifies the Active Directory SAMAccountName for Azure Storage. + */ + @JsonProperty(value = "samAccountName") + private String samAccountName; + + /* + * Specifies the Active Directory account type for Azure Storage. + */ + @JsonProperty(value = "accountType") + private AccountType accountType; + + /** + * Get the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. + * + * @param domainName the domainName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the netBiosDomainName property: Specifies the NetBIOS domain name. + * + * @return the netBiosDomainName value. + */ + public String netBiosDomainName() { + return this.netBiosDomainName; + } + + /** + * Set the netBiosDomainName property: Specifies the NetBIOS domain name. + * + * @param netBiosDomainName the netBiosDomainName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withNetBiosDomainName(String netBiosDomainName) { + this.netBiosDomainName = netBiosDomainName; + return this; + } + + /** + * Get the forestName property: Specifies the Active Directory forest to get. + * + * @return the forestName value. + */ + public String forestName() { + return this.forestName; + } + + /** + * Set the forestName property: Specifies the Active Directory forest to get. + * + * @param forestName the forestName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withForestName(String forestName) { + this.forestName = forestName; + return this; + } + + /** + * Get the domainGuid property: Specifies the domain GUID. + * + * @return the domainGuid value. + */ + public String domainGuid() { + return this.domainGuid; + } + + /** + * Set the domainGuid property: Specifies the domain GUID. + * + * @param domainGuid the domainGuid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainGuid(String domainGuid) { + this.domainGuid = domainGuid; + return this; + } + + /** + * Get the domainSid property: Specifies the security identifier (SID). + * + * @return the domainSid value. + */ + public String domainSid() { + return this.domainSid; + } + + /** + * Set the domainSid property: Specifies the security identifier (SID). + * + * @param domainSid the domainSid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainSid(String domainSid) { + this.domainSid = domainSid; + return this; + } + + /** + * Get the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. + * + * @return the azureStorageSid value. + */ + public String azureStorageSid() { + return this.azureStorageSid; + } + + /** + * Set the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. + * + * @param azureStorageSid the azureStorageSid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAzureStorageSid(String azureStorageSid) { + this.azureStorageSid = azureStorageSid; + return this; + } + + /** + * Get the samAccountName property: Specifies the Active Directory SAMAccountName for Azure Storage. + * + * @return the samAccountName value. + */ + public String samAccountName() { + return this.samAccountName; + } + + /** + * Set the samAccountName property: Specifies the Active Directory SAMAccountName for Azure Storage. + * + * @param samAccountName the samAccountName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withSamAccountName(String samAccountName) { + this.samAccountName = samAccountName; + return this; + } + + /** + * Get the accountType property: Specifies the Active Directory account type for Azure Storage. + * + * @return the accountType value. + */ + public AccountType accountType() { + return this.accountType; + } + + /** + * Set the accountType property: Specifies the Active Directory account type for Azure Storage. + * + * @param accountType the accountType value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAccountType(AccountType accountType) { + this.accountType = accountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainName in model ActiveDirectoryProperties")); + } + if (domainGuid() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainGuid in model ActiveDirectoryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryProperties.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java new file mode 100644 index 0000000000000..b1aaa6782700c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AllowedCopyScope. */ +public final class AllowedCopyScope extends ExpandableStringEnum { + /** Static value PrivateLink for AllowedCopyScope. */ + public static final AllowedCopyScope PRIVATE_LINK = fromString("PrivateLink"); + + /** Static value AAD for AllowedCopyScope. */ + public static final AllowedCopyScope AAD = fromString("AAD"); + + /** + * Creates or finds a AllowedCopyScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowedCopyScope. + */ + @JsonCreator + public static AllowedCopyScope fromString(String name) { + return fromString(name, AllowedCopyScope.class); + } + + /** + * Gets known AllowedCopyScope values. + * + * @return known AllowedCopyScope values. + */ + public static Collection values() { + return values(AllowedCopyScope.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java new file mode 100644 index 0000000000000..e920fc7007144 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AllowedMethods. */ +public final class AllowedMethods extends ExpandableStringEnum { + /** Static value DELETE for AllowedMethods. */ + public static final AllowedMethods DELETE = fromString("DELETE"); + + /** Static value GET for AllowedMethods. */ + public static final AllowedMethods GET = fromString("GET"); + + /** Static value HEAD for AllowedMethods. */ + public static final AllowedMethods HEAD = fromString("HEAD"); + + /** Static value MERGE for AllowedMethods. */ + public static final AllowedMethods MERGE = fromString("MERGE"); + + /** Static value POST for AllowedMethods. */ + public static final AllowedMethods POST = fromString("POST"); + + /** Static value OPTIONS for AllowedMethods. */ + public static final AllowedMethods OPTIONS = fromString("OPTIONS"); + + /** Static value PUT for AllowedMethods. */ + public static final AllowedMethods PUT = fromString("PUT"); + + /** Static value PATCH for AllowedMethods. */ + public static final AllowedMethods PATCH = fromString("PATCH"); + + /** + * Creates or finds a AllowedMethods from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowedMethods. + */ + @JsonCreator + public static AllowedMethods fromString(String name) { + return fromString(name, AllowedMethods.class); + } + + /** + * Gets known AllowedMethods values. + * + * @return known AllowedMethods values. + */ + public static Collection values() { + return values(AllowedMethods.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java new file mode 100644 index 0000000000000..2bc71ff55623b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Entity Resource + * + *

The resource model definition for an Azure Resource Manager resource with an etag. + */ +@Immutable +public class AzureEntityResource extends ProxyResource { + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java new file mode 100644 index 0000000000000..83bfb60cbd844 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for Azure Files identity based authentication. */ +@Fluent +public final class AzureFilesIdentityBasedAuthentication { + /* + * Indicates the directory service used. Note that this enum may be extended in the future. + */ + @JsonProperty(value = "directoryServiceOptions", required = true) + private DirectoryServiceOptions directoryServiceOptions; + + /* + * Required if directoryServiceOptions are AD, optional if they are AADKERB. + */ + @JsonProperty(value = "activeDirectoryProperties") + private ActiveDirectoryProperties activeDirectoryProperties; + + /* + * Default share permission for users using Kerberos authentication if RBAC role is not assigned. + */ + @JsonProperty(value = "defaultSharePermission") + private DefaultSharePermission defaultSharePermission; + + /** + * Get the directoryServiceOptions property: Indicates the directory service used. Note that this enum may be + * extended in the future. + * + * @return the directoryServiceOptions value. + */ + public DirectoryServiceOptions directoryServiceOptions() { + return this.directoryServiceOptions; + } + + /** + * Set the directoryServiceOptions property: Indicates the directory service used. Note that this enum may be + * extended in the future. + * + * @param directoryServiceOptions the directoryServiceOptions value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withDirectoryServiceOptions( + DirectoryServiceOptions directoryServiceOptions) { + this.directoryServiceOptions = directoryServiceOptions; + return this; + } + + /** + * Get the activeDirectoryProperties property: Required if directoryServiceOptions are AD, optional if they are + * AADKERB. + * + * @return the activeDirectoryProperties value. + */ + public ActiveDirectoryProperties activeDirectoryProperties() { + return this.activeDirectoryProperties; + } + + /** + * Set the activeDirectoryProperties property: Required if directoryServiceOptions are AD, optional if they are + * AADKERB. + * + * @param activeDirectoryProperties the activeDirectoryProperties value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withActiveDirectoryProperties( + ActiveDirectoryProperties activeDirectoryProperties) { + this.activeDirectoryProperties = activeDirectoryProperties; + return this; + } + + /** + * Get the defaultSharePermission property: Default share permission for users using Kerberos authentication if RBAC + * role is not assigned. + * + * @return the defaultSharePermission value. + */ + public DefaultSharePermission defaultSharePermission() { + return this.defaultSharePermission; + } + + /** + * Set the defaultSharePermission property: Default share permission for users using Kerberos authentication if RBAC + * role is not assigned. + * + * @param defaultSharePermission the defaultSharePermission value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withDefaultSharePermission( + DefaultSharePermission defaultSharePermission) { + this.defaultSharePermission = defaultSharePermission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (directoryServiceOptions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property directoryServiceOptions in model" + + " AzureFilesIdentityBasedAuthentication")); + } + if (activeDirectoryProperties() != null) { + activeDirectoryProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureFilesIdentityBasedAuthentication.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java new file mode 100644 index 0000000000000..ec0471dc791e7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of BlobContainer. */ +public interface BlobContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the version property: The version of the deleted blob container. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * Gets the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * Gets the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, + * only when the container is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * Gets the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * Gets the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the hasImmutabilityPolicy property: 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. + * + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * Gets the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageWithVersioning immutableStorageWithVersioning(); + + /** + * Gets the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + Boolean enableNfsV3RootSquash(); + + /** + * Gets the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + Boolean enableNfsV3AllSquash(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner object. + * + * @return the inner object. + */ + BlobContainerInner innerModel(); + + /** The entirety of the BlobContainer definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BlobContainer definition stages. */ + interface DefinitionStages { + /** The first stage of the BlobContainer definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BlobContainer definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the BlobContainer definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDefaultEncryptionScope, + DefinitionStages.WithDenyEncryptionScopeOverride, + DefinitionStages.WithPublicAccess, + DefinitionStages.WithMetadata, + DefinitionStages.WithImmutableStorageWithVersioning, + DefinitionStages.WithEnableNfsV3RootSquash, + DefinitionStages.WithEnableNfsV3AllSquash { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobContainer create(Context context); + } + /** The stage of the BlobContainer definition allowing to specify defaultEncryptionScope. */ + interface WithDefaultEncryptionScope { + /** + * Specifies the defaultEncryptionScope property: Default the container to use specified encryption scope + * for all writes.. + * + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes. + * @return the next definition stage. + */ + WithCreate withDefaultEncryptionScope(String defaultEncryptionScope); + } + /** The stage of the BlobContainer definition allowing to specify denyEncryptionScopeOverride. */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies the denyEncryptionScopeOverride property: Block override of encryption scope from the container + * default.. + * + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default. + * @return the next definition stage. + */ + WithCreate withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + /** The stage of the BlobContainer definition allowing to specify publicAccess. */ + interface WithPublicAccess { + /** + * Specifies the publicAccess property: Specifies whether data in the container may be accessed publicly and + * the level of access.. + * + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of + * access. + * @return the next definition stage. + */ + WithCreate withPublicAccess(PublicAccess publicAccess); + } + /** The stage of the BlobContainer definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the container as metadata.. + * + * @param metadata A name-value pair to associate with the container as metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + /** The stage of the BlobContainer definition allowing to specify immutableStorageWithVersioning. */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning); + } + /** The stage of the BlobContainer definition allowing to specify enableNfsV3RootSquash. */ + interface WithEnableNfsV3RootSquash { + /** + * Specifies the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container.. + * + * @param enableNfsV3RootSquash Enable NFSv3 root squash on blob container. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash); + } + /** The stage of the BlobContainer definition allowing to specify enableNfsV3AllSquash. */ + interface WithEnableNfsV3AllSquash { + /** + * Specifies the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container.. + * + * @param enableNfsV3AllSquash Enable NFSv3 all squash on blob container. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash); + } + } + /** + * Begins update for the BlobContainer resource. + * + * @return the stage of resource update. + */ + BlobContainer.Update update(); + + /** The template for BlobContainer update. */ + interface Update + extends UpdateStages.WithDefaultEncryptionScope, + UpdateStages.WithDenyEncryptionScopeOverride, + UpdateStages.WithPublicAccess, + UpdateStages.WithMetadata, + UpdateStages.WithImmutableStorageWithVersioning, + UpdateStages.WithEnableNfsV3RootSquash, + UpdateStages.WithEnableNfsV3AllSquash { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobContainer apply(Context context); + } + /** The BlobContainer update stages. */ + interface UpdateStages { + /** The stage of the BlobContainer update allowing to specify defaultEncryptionScope. */ + interface WithDefaultEncryptionScope { + /** + * Specifies the defaultEncryptionScope property: Default the container to use specified encryption scope + * for all writes.. + * + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes. + * @return the next definition stage. + */ + Update withDefaultEncryptionScope(String defaultEncryptionScope); + } + /** The stage of the BlobContainer update allowing to specify denyEncryptionScopeOverride. */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies the denyEncryptionScopeOverride property: Block override of encryption scope from the container + * default.. + * + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default. + * @return the next definition stage. + */ + Update withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + /** The stage of the BlobContainer update allowing to specify publicAccess. */ + interface WithPublicAccess { + /** + * Specifies the publicAccess property: Specifies whether data in the container may be accessed publicly and + * the level of access.. + * + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of + * access. + * @return the next definition stage. + */ + Update withPublicAccess(PublicAccess publicAccess); + } + /** The stage of the BlobContainer update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the container as metadata.. + * + * @param metadata A name-value pair to associate with the container as metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + /** The stage of the BlobContainer update allowing to specify immutableStorageWithVersioning. */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning); + } + /** The stage of the BlobContainer update allowing to specify enableNfsV3RootSquash. */ + interface WithEnableNfsV3RootSquash { + /** + * Specifies the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container.. + * + * @param enableNfsV3RootSquash Enable NFSv3 root squash on blob container. + * @return the next definition stage. + */ + Update withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash); + } + /** The stage of the BlobContainer update allowing to specify enableNfsV3AllSquash. */ + interface WithEnableNfsV3AllSquash { + /** + * Specifies the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container.. + * + * @param enableNfsV3AllSquash Enable NFSv3 all squash on blob container. + * @return the next definition stage. + */ + Update withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobContainer refresh(Context context); + + /** + * 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. + * + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + LegalHold setLegalHold(LegalHoldInner legalHold); + + /** + * 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. + * + * @param legalHold The LegalHold property that will be set to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + Response setLegalHoldWithResponse(LegalHoldInner legalHold, Context context); + + /** + * 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. + * + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + LegalHold clearLegalHold(LegalHoldInner legalHold); + + /** + * 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. + * + * @param legalHold The LegalHold property that will be clear from a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + Response clearLegalHoldWithResponse(LegalHoldInner legalHold, Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema. + */ + LeaseContainerResponse lease(); + + /** + * 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. + * + * @param parameters Lease Container request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response}. + */ + Response leaseWithResponse(LeaseContainerRequest parameters, Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void objectLevelWorm(); + + /** + * 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void objectLevelWorm(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java new file mode 100644 index 0000000000000..ed678c83bc5fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; + +/** Resource collection API of BlobContainers. */ +public interface BlobContainers { + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include, + Context context); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container. + */ + BlobContainer get(String resourceGroupName, String accountName, String containerName); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String containerName, Context context); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + LegalHold setLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + Response setLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container. + */ + LegalHold clearLegalHold( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the LegalHold property of a blob container along with {@link Response}. + */ + Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + ImmutabilityPolicy getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + Response getImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy deleteImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response deleteImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy lockImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response lockImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy extendImmutabilityPolicy( + String resourceGroupName, String accountName, String containerName, String ifMatch); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param 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. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response extendImmutabilityPolicyWithResponse( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema. + */ + LeaseContainerResponse lease(String resourceGroupName, String accountName, String containerName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response}. + */ + Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void objectLevelWorm(String resourceGroupName, String accountName, String containerName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every + * dash (-) character must be immediately preceded and followed by a letter or number. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context); + + /** + * Gets properties of a specified container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response}. + */ + BlobContainer getById(String id); + + /** + * Gets properties of a specified container. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + ImmutabilityPolicy getImmutabilityPolicyById(String id); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param id the resource ID. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + Response getImmutabilityPolicyByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Deletes specified container under its account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specified container under its account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * 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. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy deleteImmutabilityPolicyById(String id); + + /** + * 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. + * + * @param id the resource ID. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response deleteImmutabilityPolicyByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new BlobContainer resource. + * + * @param name resource name. + * @return the first stage of the new BlobContainer definition. + */ + BlobContainer.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new ImmutabilityPolicy resource. + * + * @return the first stage of the new ImmutabilityPolicy definition. + */ + ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..e196da54fb2f8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersCreateOrUpdateImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..00b88d598526c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Contains all response data for the createOrUpdateImmutabilityPolicy operation. */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersCreateOrUpdateImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersCreateOrUpdateImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, + BlobContainersCreateOrUpdateImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..28d86c073fbe4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersDeleteImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersDeleteImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. + */ + public BlobContainersDeleteImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..037067df6eb97 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Contains all response data for the deleteImmutabilityPolicy operation. */ +public final class BlobContainersDeleteImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersDeleteImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersDeleteImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersDeleteImmutabilityPolicyResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, + BlobContainersDeleteImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..bdf3f8d316f37 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersExtendImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersExtendImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. + */ + public BlobContainersExtendImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..262064601c784 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Contains all response data for the extendImmutabilityPolicy operation. */ +public final class BlobContainersExtendImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersExtendImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersExtendImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersExtendImmutabilityPolicyResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, + BlobContainersExtendImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..f930bea4151cc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersGetImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersGetImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. + */ + public BlobContainersGetImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..d9e57a74b4262 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Contains all response data for the getImmutabilityPolicy operation. */ +public final class BlobContainersGetImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersGetImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersGetImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersGetImmutabilityPolicyResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, + BlobContainersGetImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..6be1a969f2564 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersLockImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersLockImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. + */ + public BlobContainersLockImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..18480ec479277 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Contains all response data for the lockImmutabilityPolicy operation. */ +public final class BlobContainersLockImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersLockImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersLockImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersLockImmutabilityPolicyResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, + BlobContainersLockImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java new file mode 100644 index 0000000000000..228326c26a728 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BlobInventoryPolicies. */ +public interface BlobInventoryPolicies { + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account. + */ + BlobInventoryPolicy get( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + BlobInventoryPolicy getById(String id); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BlobInventoryPolicy resource. + * + * @param name resource name. + * @return the first stage of the new BlobInventoryPolicy definition. + */ + BlobInventoryPolicy.DefinitionStages.Blank define(BlobInventoryPolicyName name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java new file mode 100644 index 0000000000000..c7ee630f2fe5b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of BlobInventoryPolicy. */ +public interface BlobInventoryPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + BlobInventoryPolicySchema policy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner object. + * + * @return the inner object. + */ + BlobInventoryPolicyInner innerModel(); + + /** The entirety of the BlobInventoryPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BlobInventoryPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the BlobInventoryPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BlobInventoryPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the BlobInventoryPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobInventoryPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobInventoryPolicy create(Context context); + } + /** The stage of the BlobInventoryPolicy definition allowing to specify policy. */ + interface WithPolicy { + /** + * Specifies the policy property: The storage account blob inventory policy object. It is composed of policy + * rules.. + * + * @param policy The storage account blob inventory policy object. It is composed of policy rules. + * @return the next definition stage. + */ + WithCreate withPolicy(BlobInventoryPolicySchema policy); + } + } + /** + * Begins update for the BlobInventoryPolicy resource. + * + * @return the stage of resource update. + */ + BlobInventoryPolicy.Update update(); + + /** The template for BlobInventoryPolicy update. */ + interface Update extends UpdateStages.WithPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobInventoryPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobInventoryPolicy apply(Context context); + } + /** The BlobInventoryPolicy update stages. */ + interface UpdateStages { + /** The stage of the BlobInventoryPolicy update allowing to specify policy. */ + interface WithPolicy { + /** + * Specifies the policy property: The storage account blob inventory policy object. It is composed of policy + * rules.. + * + * @param policy The storage account blob inventory policy object. It is composed of policy rules. + * @return the next definition stage. + */ + Update withPolicy(BlobInventoryPolicySchema policy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobInventoryPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobInventoryPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java new file mode 100644 index 0000000000000..1136daa5763f0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that defines the blob inventory rule. */ +@Fluent +public final class BlobInventoryPolicyDefinition { + /* + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private BlobInventoryPolicyFilter filters; + + /* + * This is a required field, it specifies the format for the inventory files. + */ + @JsonProperty(value = "format", required = true) + private Format format; + + /* + * This is a required field. This field is used to schedule an inventory formation. + */ + @JsonProperty(value = "schedule", required = true) + private Schedule schedule; + + /* + * This is a required field. This field specifies the scope of the inventory created either at the blob or + * container level. + */ + @JsonProperty(value = "objectType", required = true) + private ObjectType objectType; + + /* + * 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. + */ + @JsonProperty(value = "schemaFields", required = true) + private List schemaFields; + + /** + * Get the filters property: An object that defines the filter set. + * + * @return the filters value. + */ + public BlobInventoryPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withFilters(BlobInventoryPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Get the format property: This is a required field, it specifies the format for the inventory files. + * + * @return the format value. + */ + public Format format() { + return this.format; + } + + /** + * Set the format property: This is a required field, it specifies the format for the inventory files. + * + * @param format the format value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withFormat(Format format) { + this.format = format; + return this; + } + + /** + * Get the schedule property: This is a required field. This field is used to schedule an inventory formation. + * + * @return the schedule value. + */ + public Schedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: This is a required field. This field is used to schedule an inventory formation. + * + * @param schedule the schedule value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withSchedule(Schedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the objectType property: This is a required field. This field specifies the scope of the inventory created + * either at the blob or container level. + * + * @return the objectType value. + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: This is a required field. This field specifies the scope of the inventory created + * either at the blob or container level. + * + * @param objectType the objectType value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the schemaFields property: 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. + * + * @return the schemaFields value. + */ + public List schemaFields() { + return this.schemaFields; + } + + /** + * Set the schemaFields property: 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. + * + * @param schemaFields the schemaFields value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withSchemaFields(List schemaFields) { + this.schemaFields = schemaFields; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filters() != null) { + filters().validate(); + } + if (format() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property format in model BlobInventoryPolicyDefinition")); + } + if (schedule() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schedule in model BlobInventoryPolicyDefinition")); + } + if (objectType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectType in model BlobInventoryPolicyDefinition")); + } + if (schemaFields() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schemaFields in model BlobInventoryPolicyDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyDefinition.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java new file mode 100644 index 0000000000000..be6dd3e2b64d8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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. + */ +@Fluent +public final class BlobInventoryPolicyFilter { + /* + * An array of strings with maximum 10 blob prefixes to be included in the inventory. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /* + * An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + */ + @JsonProperty(value = "excludePrefix") + private List excludePrefix; + + /* + * 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'. + */ + @JsonProperty(value = "blobTypes") + private List blobTypes; + + /* + * 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. + */ + @JsonProperty(value = "includeBlobVersions") + private Boolean includeBlobVersions; + + /* + * 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. + */ + @JsonProperty(value = "includeSnapshots") + private Boolean includeSnapshots; + + /* + * 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. + */ + @JsonProperty(value = "includeDeleted") + private Boolean includeDeleted; + + /** + * Get the prefixMatch property: An array of strings with maximum 10 blob prefixes to be included in the inventory. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: An array of strings with maximum 10 blob prefixes to be included in the inventory. + * + * @param prefixMatch the prefixMatch value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the excludePrefix property: An array of strings with maximum 10 blob prefixes to be excluded from the + * inventory. + * + * @return the excludePrefix value. + */ + public List excludePrefix() { + return this.excludePrefix; + } + + /** + * Set the excludePrefix property: An array of strings with maximum 10 blob prefixes to be excluded from the + * inventory. + * + * @param excludePrefix the excludePrefix value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withExcludePrefix(List excludePrefix) { + this.excludePrefix = excludePrefix; + return this; + } + + /** + * Get the blobTypes property: 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'. + * + * @return the blobTypes value. + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set the blobTypes property: 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'. + * + * @param blobTypes the blobTypes value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + + /** + * Get the includeBlobVersions property: 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. + * + * @return the includeBlobVersions value. + */ + public Boolean includeBlobVersions() { + return this.includeBlobVersions; + } + + /** + * Set the includeBlobVersions property: 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. + * + * @param includeBlobVersions the includeBlobVersions value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeBlobVersions(Boolean includeBlobVersions) { + this.includeBlobVersions = includeBlobVersions; + return this; + } + + /** + * Get the includeSnapshots property: 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. + * + * @return the includeSnapshots value. + */ + public Boolean includeSnapshots() { + return this.includeSnapshots; + } + + /** + * Set the includeSnapshots property: 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. + * + * @param includeSnapshots the includeSnapshots value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeSnapshots(Boolean includeSnapshots) { + this.includeSnapshots = includeSnapshots; + return this; + } + + /** + * Get the includeDeleted property: 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. + * + * @return the includeDeleted value. + */ + public Boolean includeDeleted() { + return this.includeDeleted; + } + + /** + * Set the includeDeleted property: 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. + * + * @param includeDeleted the includeDeleted value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeDeleted(Boolean includeDeleted) { + this.includeDeleted = includeDeleted; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java new file mode 100644 index 0000000000000..dc2a8a5b026d7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobInventoryPolicyName. */ +public final class BlobInventoryPolicyName extends ExpandableStringEnum { + /** Static value default for BlobInventoryPolicyName. */ + public static final BlobInventoryPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a BlobInventoryPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobInventoryPolicyName. + */ + @JsonCreator + public static BlobInventoryPolicyName fromString(String name) { + return fromString(name, BlobInventoryPolicyName.class); + } + + /** + * Gets known BlobInventoryPolicyName values. + * + * @return known BlobInventoryPolicyName values. + */ + public static Collection values() { + return values(BlobInventoryPolicyName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java new file mode 100644 index 0000000000000..a05c62a7109cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that wraps the blob inventory rule. Each rule is uniquely defined by name. */ +@Fluent +public final class BlobInventoryPolicyRule { + /* + * Rule is enabled when set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be + * unique within a policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Container name where blob inventory files are stored. Must be pre-created. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * An object that defines the blob inventory policy rule. + */ + @JsonProperty(value = "definition", required = true) + private BlobInventoryPolicyDefinition definition; + + /** + * Get the enabled property: Rule is enabled when set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Rule is enabled when set to true. + * + * @param enabled the enabled value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @param name the name value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the destination property: Container name where blob inventory files are stored. Must be pre-created. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Container name where blob inventory files are stored. Must be pre-created. + * + * @param destination the destination value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the definition property: An object that defines the blob inventory policy rule. + * + * @return the definition value. + */ + public BlobInventoryPolicyDefinition definition() { + return this.definition; + } + + /** + * Set the definition property: An object that defines the blob inventory policy rule. + * + * @param definition the definition value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withDefinition(BlobInventoryPolicyDefinition definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model BlobInventoryPolicyRule")); + } + if (destination() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model BlobInventoryPolicyRule")); + } + if (definition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property definition in model BlobInventoryPolicyRule")); + } else { + definition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java new file mode 100644 index 0000000000000..5b09549729934 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The storage account blob inventory policy rules. */ +@Fluent +public final class BlobInventoryPolicySchema { + /* + * Policy is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be + * specified at the rule level 'policy.rule.destination' + */ + @JsonProperty(value = "destination", access = JsonProperty.Access.WRITE_ONLY) + private String destination; + + /* + * The valid value is Inventory + */ + @JsonProperty(value = "type", required = true) + private InventoryRuleType type; + + /* + * The storage account blob inventory policy rules. The rule is applied when it is enabled. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the enabled property: Policy is enabled if set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Policy is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the destination property: Deprecated Property from API version 2021-04-01 onwards, the required destination + * container name must be specified at the rule level 'policy.rule.destination'. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Get the type property: The valid value is Inventory. + * + * @return the type value. + */ + public InventoryRuleType type() { + return this.type; + } + + /** + * Set the type property: The valid value is Inventory. + * + * @param type the type value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withType(InventoryRuleType type) { + this.type = type; + return this; + } + + /** + * Get the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. + * + * @param rules the rules value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model BlobInventoryPolicySchema")); + } + if (rules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rules in model BlobInventoryPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicySchema.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java new file mode 100644 index 0000000000000..063d66b01137a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Blob restore parameters. */ +@Fluent +public final class BlobRestoreParameters { + /* + * Restore blob to the specified time. + */ + @JsonProperty(value = "timeToRestore", required = true) + private OffsetDateTime timeToRestore; + + /* + * Blob ranges to restore. + */ + @JsonProperty(value = "blobRanges", required = true) + private List blobRanges; + + /** + * Get the timeToRestore property: Restore blob to the specified time. + * + * @return the timeToRestore value. + */ + public OffsetDateTime timeToRestore() { + return this.timeToRestore; + } + + /** + * Set the timeToRestore property: Restore blob to the specified time. + * + * @param timeToRestore the timeToRestore value to set. + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withTimeToRestore(OffsetDateTime timeToRestore) { + this.timeToRestore = timeToRestore; + return this; + } + + /** + * Get the blobRanges property: Blob ranges to restore. + * + * @return the blobRanges value. + */ + public List blobRanges() { + return this.blobRanges; + } + + /** + * Set the blobRanges property: Blob ranges to restore. + * + * @param blobRanges the blobRanges value to set. + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withBlobRanges(List blobRanges) { + this.blobRanges = blobRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeToRestore() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property timeToRestore in model BlobRestoreParameters")); + } + if (blobRanges() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobRanges in model BlobRestoreParameters")); + } else { + blobRanges().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java new file mode 100644 index 0000000000000..7fb37b492acd6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobRestoreProgressStatus. */ +public final class BlobRestoreProgressStatus extends ExpandableStringEnum { + /** Static value InProgress for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Complete for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); + + /** Static value Failed for BlobRestoreProgressStatus. */ + public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a BlobRestoreProgressStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobRestoreProgressStatus. + */ + @JsonCreator + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** + * Gets known BlobRestoreProgressStatus values. + * + * @return known BlobRestoreProgressStatus values. + */ + public static Collection values() { + return values(BlobRestoreProgressStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java new file mode 100644 index 0000000000000..5c0a7cb23b5a5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob range. */ +@Fluent +public final class BlobRestoreRange { + /* + * Blob start range. This is inclusive. Empty means account start. + */ + @JsonProperty(value = "startRange", required = true) + private String startRange; + + /* + * Blob end range. This is exclusive. Empty means account end. + */ + @JsonProperty(value = "endRange", required = true) + private String endRange; + + /** + * Get the startRange property: Blob start range. This is inclusive. Empty means account start. + * + * @return the startRange value. + */ + public String startRange() { + return this.startRange; + } + + /** + * Set the startRange property: Blob start range. This is inclusive. Empty means account start. + * + * @param startRange the startRange value to set. + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withStartRange(String startRange) { + this.startRange = startRange; + return this; + } + + /** + * Get the endRange property: Blob end range. This is exclusive. Empty means account end. + * + * @return the endRange value. + */ + public String endRange() { + return this.endRange; + } + + /** + * Set the endRange property: Blob end range. This is exclusive. Empty means account end. + * + * @param endRange the endRange value to set. + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withEndRange(String endRange) { + this.endRange = endRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startRange() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property startRange in model BlobRestoreRange")); + } + if (endRange() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property endRange in model BlobRestoreRange")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreRange.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java new file mode 100644 index 0000000000000..5b0a72a7915dd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; + +/** An immutable client-side representation of BlobRestoreStatus. */ +public interface BlobRestoreStatus { + /** + * Gets the status property: 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. + * + * @return the status value. + */ + BlobRestoreProgressStatus status(); + + /** + * Gets the failureReason property: Failure reason when blob restore is failed. + * + * @return the failureReason value. + */ + String failureReason(); + + /** + * Gets the restoreId property: Id for tracking blob restore request. + * + * @return the restoreId value. + */ + String restoreId(); + + /** + * Gets the parameters property: Blob restore request parameters. + * + * @return the parameters value. + */ + BlobRestoreParameters parameters(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner object. + * + * @return the inner object. + */ + BlobRestoreStatusInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java new file mode 100644 index 0000000000000..43a90da6640aa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The BlobServiceItems model. */ +@Immutable +public final class BlobServiceItems { + /* + * List of blob services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: List of blob services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java new file mode 100644 index 0000000000000..71abd32f48711 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; + +/** An immutable client-side representation of BlobServiceProperties. */ +public interface BlobServiceProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the sku property: Sku name and tier. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the cors property: 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. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the defaultServiceVersion property: 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. + * + * @return the defaultServiceVersion value. + */ + String defaultServiceVersion(); + + /** + * Gets the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + DeleteRetentionPolicy deleteRetentionPolicy(); + + /** + * Gets the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + Boolean isVersioningEnabled(); + + /** + * Gets the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + Boolean automaticSnapshotPolicyEnabled(); + + /** + * Gets the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + ChangeFeed changeFeed(); + + /** + * Gets the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + RestorePolicyProperties restorePolicy(); + + /** + * Gets the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy containerDeleteRetentionPolicy(); + + /** + * Gets the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner object. + * + * @return the inner object. + */ + BlobServicePropertiesInner innerModel(); + + /** The entirety of the BlobServiceProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The BlobServiceProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the BlobServiceProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BlobServiceProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the BlobServiceProperties definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithCors, + DefinitionStages.WithDefaultServiceVersion, + DefinitionStages.WithDeleteRetentionPolicy, + DefinitionStages.WithIsVersioningEnabled, + DefinitionStages.WithAutomaticSnapshotPolicyEnabled, + DefinitionStages.WithChangeFeed, + DefinitionStages.WithRestorePolicy, + DefinitionStages.WithContainerDeleteRetentionPolicy, + DefinitionStages.WithLastAccessTimeTrackingPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobServiceProperties create(Context context); + } + /** The stage of the BlobServiceProperties definition allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + /** The stage of the BlobServiceProperties definition allowing to specify defaultServiceVersion. */ + interface WithDefaultServiceVersion { + /** + * Specifies the defaultServiceVersion property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + /** The stage of the BlobServiceProperties definition allowing to specify deleteRetentionPolicy. */ + interface WithDeleteRetentionPolicy { + /** + * Specifies the deleteRetentionPolicy property: The blob service properties for blob soft delete.. + * + * @param deleteRetentionPolicy The blob service properties for blob soft delete. + * @return the next definition stage. + */ + WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + /** The stage of the BlobServiceProperties definition allowing to specify isVersioningEnabled. */ + interface WithIsVersioningEnabled { + /** + * Specifies the isVersioningEnabled property: Versioning is enabled if set to true.. + * + * @param isVersioningEnabled Versioning is enabled if set to true. + * @return the next definition stage. + */ + WithCreate withIsVersioningEnabled(Boolean isVersioningEnabled); + } + /** The stage of the BlobServiceProperties definition allowing to specify automaticSnapshotPolicyEnabled. */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled + * property.. + * + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property. + * @return the next definition stage. + */ + WithCreate withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + /** The stage of the BlobServiceProperties definition allowing to specify changeFeed. */ + interface WithChangeFeed { + /** + * Specifies the changeFeed property: The blob service properties for change feed events.. + * + * @param changeFeed The blob service properties for change feed events. + * @return the next definition stage. + */ + WithCreate withChangeFeed(ChangeFeed changeFeed); + } + /** The stage of the BlobServiceProperties definition allowing to specify restorePolicy. */ + interface WithRestorePolicy { + /** + * Specifies the restorePolicy property: The blob service properties for blob restore policy.. + * + * @param restorePolicy The blob service properties for blob restore policy. + * @return the next definition stage. + */ + WithCreate withRestorePolicy(RestorePolicyProperties restorePolicy); + } + /** The stage of the BlobServiceProperties definition allowing to specify containerDeleteRetentionPolicy. */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies the containerDeleteRetentionPolicy property: The blob service properties for container soft + * delete.. + * + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete. + * @return the next definition stage. + */ + WithCreate withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + /** The stage of the BlobServiceProperties definition allowing to specify lastAccessTimeTrackingPolicy. */ + interface WithLastAccessTimeTrackingPolicy { + /** + * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access + * time based tracking policy.. + * + * @param lastAccessTimeTrackingPolicy The blob service property to configure last access time based + * tracking policy. + * @return the next definition stage. + */ + WithCreate withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy); + } + } + /** + * Begins update for the BlobServiceProperties resource. + * + * @return the stage of resource update. + */ + BlobServiceProperties.Update update(); + + /** The template for BlobServiceProperties update. */ + interface Update + extends UpdateStages.WithCors, + UpdateStages.WithDefaultServiceVersion, + UpdateStages.WithDeleteRetentionPolicy, + UpdateStages.WithIsVersioningEnabled, + UpdateStages.WithAutomaticSnapshotPolicyEnabled, + UpdateStages.WithChangeFeed, + UpdateStages.WithRestorePolicy, + UpdateStages.WithContainerDeleteRetentionPolicy, + UpdateStages.WithLastAccessTimeTrackingPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobServiceProperties apply(Context context); + } + /** The BlobServiceProperties update stages. */ + interface UpdateStages { + /** The stage of the BlobServiceProperties update allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + /** The stage of the BlobServiceProperties update allowing to specify defaultServiceVersion. */ + interface WithDefaultServiceVersion { + /** + * Specifies the defaultServiceVersion property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + /** The stage of the BlobServiceProperties update allowing to specify deleteRetentionPolicy. */ + interface WithDeleteRetentionPolicy { + /** + * Specifies the deleteRetentionPolicy property: The blob service properties for blob soft delete.. + * + * @param deleteRetentionPolicy The blob service properties for blob soft delete. + * @return the next definition stage. + */ + Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + /** The stage of the BlobServiceProperties update allowing to specify isVersioningEnabled. */ + interface WithIsVersioningEnabled { + /** + * Specifies the isVersioningEnabled property: Versioning is enabled if set to true.. + * + * @param isVersioningEnabled Versioning is enabled if set to true. + * @return the next definition stage. + */ + Update withIsVersioningEnabled(Boolean isVersioningEnabled); + } + /** The stage of the BlobServiceProperties update allowing to specify automaticSnapshotPolicyEnabled. */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled + * property.. + * + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property. + * @return the next definition stage. + */ + Update withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + /** The stage of the BlobServiceProperties update allowing to specify changeFeed. */ + interface WithChangeFeed { + /** + * Specifies the changeFeed property: The blob service properties for change feed events.. + * + * @param changeFeed The blob service properties for change feed events. + * @return the next definition stage. + */ + Update withChangeFeed(ChangeFeed changeFeed); + } + /** The stage of the BlobServiceProperties update allowing to specify restorePolicy. */ + interface WithRestorePolicy { + /** + * Specifies the restorePolicy property: The blob service properties for blob restore policy.. + * + * @param restorePolicy The blob service properties for blob restore policy. + * @return the next definition stage. + */ + Update withRestorePolicy(RestorePolicyProperties restorePolicy); + } + /** The stage of the BlobServiceProperties update allowing to specify containerDeleteRetentionPolicy. */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies the containerDeleteRetentionPolicy property: The blob service properties for container soft + * delete.. + * + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete. + * @return the next definition stage. + */ + Update withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + /** The stage of the BlobServiceProperties update allowing to specify lastAccessTimeTrackingPolicy. */ + interface WithLastAccessTimeTrackingPolicy { + /** + * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access + * time based tracking policy.. + * + * @param lastAccessTimeTrackingPolicy The blob service property to configure last access time based + * tracking policy. + * @return the next definition stage. + */ + Update withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java new file mode 100644 index 0000000000000..86b85f30e5109 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BlobServices. */ +public interface BlobServices { + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + BlobServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + BlobServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BlobServiceProperties resource. + * + * @return the first stage of the new BlobServiceProperties definition. + */ + BlobServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java new file mode 100644 index 0000000000000..18b8b23a68c1f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Bypass. */ +public final class Bypass extends ExpandableStringEnum { + /** Static value None for Bypass. */ + public static final Bypass NONE = fromString("None"); + + /** Static value Logging for Bypass. */ + public static final Bypass LOGGING = fromString("Logging"); + + /** Static value Metrics for Bypass. */ + public static final Bypass METRICS = fromString("Metrics"); + + /** Static value AzureServices for Bypass. */ + public static final Bypass AZURE_SERVICES = fromString("AzureServices"); + + /** + * Creates or finds a Bypass from its string representation. + * + * @param name a name to look for. + * @return the corresponding Bypass. + */ + @JsonCreator + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** + * Gets known Bypass values. + * + * @return known Bypass values. + */ + public static Collection values() { + return values(Bypass.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java new file mode 100644 index 0000000000000..945dfaccd956d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The blob service properties for change feed events. */ +@Fluent +public final class ChangeFeed { + /* + * Indicates whether change feed event logging is enabled for the Blob service. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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. + */ + @JsonProperty(value = "retentionInDays") + private Integer retentionInDays; + + /** + * Get the enabled property: Indicates whether change feed event logging is enabled for the Blob service. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether change feed event logging is enabled for the Blob service. + * + * @param enabled the enabled value to set. + * @return the ChangeFeed object itself. + */ + public ChangeFeed withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionInDays property: 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. + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: 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. + * + * @param retentionInDays the retentionInDays value to set. + * @return the ChangeFeed object itself. + */ + public ChangeFeed withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..9f009f279f86f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: 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. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Gets the reason that a storage account name could not be used. The Reason element is + * only returned if NameAvailable is false. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java new file mode 100644 index 0000000000000..a5a0adcde914c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a CORS rule for the Blob service. */ +@Fluent +public final class CorsRule { + /* + * Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow + * all domains + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /* + * Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + */ + @JsonProperty(value = "allowedMethods", required = true) + private List allowedMethods; + + /* + * Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight + * response. + */ + @JsonProperty(value = "maxAgeInSeconds", required = true) + private int maxAgeInSeconds; + + /* + * Required if CorsRule element is present. A list of response headers to expose to CORS clients. + */ + @JsonProperty(value = "exposedHeaders", required = true) + private List exposedHeaders; + + /* + * Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + */ + @JsonProperty(value = "allowedHeaders", required = true) + private List allowedHeaders; + + /** + * Get the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be + * allowed via CORS, or "*" to allow all domains. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be + * allowed via CORS, or "*" to allow all domains. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed + * to be executed by the origin. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed + * to be executed by the origin. + * + * @param allowedMethods the allowedMethods value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + * + * @return the maxAgeInSeconds value. + */ + public int maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set. + * @return the CorsRule object itself. + */ + public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + + /** + * Get the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to + * CORS clients. + * + * @return the exposedHeaders value. + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to + * CORS clients. + * + * @param exposedHeaders the exposedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of + * the cross-origin request. + * + * @return the allowedHeaders value. + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of + * the cross-origin request. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedOrigins() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedOrigins in model CorsRule")); + } + if (allowedMethods() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedMethods in model CorsRule")); + } + if (exposedHeaders() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property exposedHeaders in model CorsRule")); + } + if (allowedHeaders() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedHeaders in model CorsRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CorsRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java new file mode 100644 index 0000000000000..1eb3ac939df57 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sets the CORS rules. You can include up to five CorsRule elements in the request. */ +@Fluent +public final class CorsRules { + /* + * The List of CORS rules. You can include up to five CorsRule elements in the request. + */ + @JsonProperty(value = "corsRules") + private List corsRules; + + /** + * Get the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @return the corsRules value. + */ + public List corsRules() { + return this.corsRules; + } + + /** + * Set the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @param corsRules the corsRules value to set. + * @return the CorsRules object itself. + */ + public CorsRules withCorsRules(List corsRules) { + this.corsRules = corsRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (corsRules() != null) { + corsRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java new file mode 100644 index 0000000000000..2ec076761cae3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The custom domain assigned to this storage account. This can be set via Update. */ +@Fluent +public final class CustomDomain { + /* + * Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on + * updates. + */ + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; + + /** + * Get the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME + * source. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME + * source. + * + * @param name the name value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + * + * @return the useSubDomainName value. + */ + public Boolean useSubDomainName() { + return this.useSubDomainName; + } + + /** + * Set the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + * + * @param useSubDomainName the useSubDomainName value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CustomDomain")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java new file mode 100644 index 0000000000000..036ab8dd658e5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object to define snapshot and version action conditions. */ +@Fluent +public final class DateAfterCreation { + /* + * Value indicating the age in days after creation + */ + @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) + private float daysAfterCreationGreaterThan; + + /* + * 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. + */ + @JsonProperty(value = "daysAfterLastTierChangeGreaterThan") + private Float daysAfterLastTierChangeGreaterThan; + + /** + * Get the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. + * + * @return the daysAfterCreationGreaterThan value. + */ + public float daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set. + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterCreationGreaterThan(float daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + return this; + } + + /** + * Get the daysAfterLastTierChangeGreaterThan property: 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. + * + * @return the daysAfterLastTierChangeGreaterThan value. + */ + public Float daysAfterLastTierChangeGreaterThan() { + return this.daysAfterLastTierChangeGreaterThan; + } + + /** + * Set the daysAfterLastTierChangeGreaterThan property: 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. + * + * @param daysAfterLastTierChangeGreaterThan the daysAfterLastTierChangeGreaterThan value to set. + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterLastTierChangeGreaterThan(Float daysAfterLastTierChangeGreaterThan) { + this.daysAfterLastTierChangeGreaterThan = daysAfterLastTierChangeGreaterThan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java new file mode 100644 index 0000000000000..151678893426b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +@Fluent +public final class DateAfterModification { + /* + * Value indicating the age in days after last modification + */ + @JsonProperty(value = "daysAfterModificationGreaterThan") + private Float daysAfterModificationGreaterThan; + + /* + * Value indicating the age in days after last blob access. This property can only be used in conjunction with last + * access time tracking policy + */ + @JsonProperty(value = "daysAfterLastAccessTimeGreaterThan") + private Float daysAfterLastAccessTimeGreaterThan; + + /* + * 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. + */ + @JsonProperty(value = "daysAfterLastTierChangeGreaterThan") + private Float daysAfterLastTierChangeGreaterThan; + + /* + * Value indicating the age in days after blob creation. + */ + @JsonProperty(value = "daysAfterCreationGreaterThan") + private Float daysAfterCreationGreaterThan; + + /** + * Get the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. + * + * @return the daysAfterModificationGreaterThan value. + */ + public Float daysAfterModificationGreaterThan() { + return this.daysAfterModificationGreaterThan; + } + + /** + * Set the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. + * + * @param daysAfterModificationGreaterThan the daysAfterModificationGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterModificationGreaterThan(Float daysAfterModificationGreaterThan) { + this.daysAfterModificationGreaterThan = daysAfterModificationGreaterThan; + return this; + } + + /** + * Get the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. + * This property can only be used in conjunction with last access time tracking policy. + * + * @return the daysAfterLastAccessTimeGreaterThan value. + */ + public Float daysAfterLastAccessTimeGreaterThan() { + return this.daysAfterLastAccessTimeGreaterThan; + } + + /** + * Set the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. + * This property can only be used in conjunction with last access time tracking policy. + * + * @param daysAfterLastAccessTimeGreaterThan the daysAfterLastAccessTimeGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterLastAccessTimeGreaterThan(Float daysAfterLastAccessTimeGreaterThan) { + this.daysAfterLastAccessTimeGreaterThan = daysAfterLastAccessTimeGreaterThan; + return this; + } + + /** + * Get the daysAfterLastTierChangeGreaterThan property: 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. + * + * @return the daysAfterLastTierChangeGreaterThan value. + */ + public Float daysAfterLastTierChangeGreaterThan() { + return this.daysAfterLastTierChangeGreaterThan; + } + + /** + * Set the daysAfterLastTierChangeGreaterThan property: 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. + * + * @param daysAfterLastTierChangeGreaterThan the daysAfterLastTierChangeGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterLastTierChangeGreaterThan(Float daysAfterLastTierChangeGreaterThan) { + this.daysAfterLastTierChangeGreaterThan = daysAfterLastTierChangeGreaterThan; + return this; + } + + /** + * Get the daysAfterCreationGreaterThan property: Value indicating the age in days after blob creation. + * + * @return the daysAfterCreationGreaterThan value. + */ + public Float daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set the daysAfterCreationGreaterThan property: Value indicating the age in days after blob creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterCreationGreaterThan(Float daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java new file mode 100644 index 0000000000000..7c56ab13792be --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DefaultAction. */ +public enum DefaultAction { + /** Enum value Allow. */ + ALLOW("Allow"), + + /** Enum value Deny. */ + DENY("Deny"); + + /** The actual serialized value for a DefaultAction instance. */ + private final String value; + + DefaultAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultAction object, or null if unable to parse. + */ + @JsonCreator + public static DefaultAction fromString(String value) { + if (value == null) { + return null; + } + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java new file mode 100644 index 0000000000000..20f8238ef7f42 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultSharePermission. */ +public final class DefaultSharePermission extends ExpandableStringEnum { + /** Static value None for DefaultSharePermission. */ + public static final DefaultSharePermission NONE = fromString("None"); + + /** Static value StorageFileDataSmbShareReader for DefaultSharePermission. */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_READER = + fromString("StorageFileDataSmbShareReader"); + + /** Static value StorageFileDataSmbShareContributor for DefaultSharePermission. */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_CONTRIBUTOR = + fromString("StorageFileDataSmbShareContributor"); + + /** Static value StorageFileDataSmbShareElevatedContributor for DefaultSharePermission. */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_ELEVATED_CONTRIBUTOR = + fromString("StorageFileDataSmbShareElevatedContributor"); + + /** + * Creates or finds a DefaultSharePermission from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultSharePermission. + */ + @JsonCreator + public static DefaultSharePermission fromString(String name) { + return fromString(name, DefaultSharePermission.class); + } + + /** + * Gets known DefaultSharePermission values. + * + * @return known DefaultSharePermission values. + */ + public static Collection values() { + return values(DefaultSharePermission.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java new file mode 100644 index 0000000000000..c7688e313d089 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The service properties for soft delete. */ +@Fluent +public final class DeleteRetentionPolicy { + /* + * Indicates whether DeleteRetentionPolicy is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * 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. + */ + @JsonProperty(value = "allowPermanentDelete") + private Boolean allowPermanentDelete; + + /** + * Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled. + * + * @param enabled the enabled value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the days property: 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. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: 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. + * + * @param days the days value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the allowPermanentDelete property: 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. + * + * @return the allowPermanentDelete value. + */ + public Boolean allowPermanentDelete() { + return this.allowPermanentDelete; + } + + /** + * Set the allowPermanentDelete property: 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. + * + * @param allowPermanentDelete the allowPermanentDelete value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withAllowPermanentDelete(Boolean allowPermanentDelete) { + this.allowPermanentDelete = allowPermanentDelete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java new file mode 100644 index 0000000000000..6e614aa9cd110 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; + +/** An immutable client-side representation of DeletedAccount. */ +public interface DeletedAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + String storageAccountResourceId(); + + /** + * Gets the location property: Location of the deleted account. + * + * @return the location value. + */ + String location(); + + /** + * Gets the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + String restoreReference(); + + /** + * Gets the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + String creationTime(); + + /** + * Gets the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + String deletionTime(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner object. + * + * @return the inner object. + */ + DeletedAccountInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java new file mode 100644 index 0000000000000..0e0201fa3c271 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Deleted Accounts operation. */ +@Immutable +public final class DeletedAccountListResult { + /* + * Gets the list of deleted accounts and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Gets the list of deleted accounts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java new file mode 100644 index 0000000000000..0bc9bc4b2b0e1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DeletedAccounts. */ +public interface DeletedAccounts { + /** + * Lists deleted accounts under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists deleted accounts under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + DeletedAccount get(String deletedAccountName, String location); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + Response getWithResponse(String deletedAccountName, String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java new file mode 100644 index 0000000000000..8c6aa754ae6ac --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The deleted share to be restored. */ +@Fluent +public final class DeletedShare { + /* + * Required. Identify the name of the deleted share that will be restored. + */ + @JsonProperty(value = "deletedShareName", required = true) + private String deletedShareName; + + /* + * Required. Identify the version of the deleted share that will be restored. + */ + @JsonProperty(value = "deletedShareVersion", required = true) + private String deletedShareVersion; + + /** + * Get the deletedShareName property: Required. Identify the name of the deleted share that will be restored. + * + * @return the deletedShareName value. + */ + public String deletedShareName() { + return this.deletedShareName; + } + + /** + * Set the deletedShareName property: Required. Identify the name of the deleted share that will be restored. + * + * @param deletedShareName the deletedShareName value to set. + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareName(String deletedShareName) { + this.deletedShareName = deletedShareName; + return this; + } + + /** + * Get the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. + * + * @return the deletedShareVersion value. + */ + public String deletedShareVersion() { + return this.deletedShareVersion; + } + + /** + * Set the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. + * + * @param deletedShareVersion the deletedShareVersion value to set. + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareVersion(String deletedShareVersion) { + this.deletedShareVersion = deletedShareVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deletedShareName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property deletedShareName in model DeletedShare")); + } + if (deletedShareVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deletedShareVersion in model DeletedShare")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeletedShare.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java new file mode 100644 index 0000000000000..99261bd73126a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimension of blobs, possibly be blob type or access tier. */ +@Fluent +public final class Dimension { + /* + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: Display name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of dimension. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of dimension. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java new file mode 100644 index 0000000000000..87aba2edd531d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DirectoryServiceOptions. */ +public final class DirectoryServiceOptions extends ExpandableStringEnum { + /** Static value None for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions NONE = fromString("None"); + + /** Static value AADDS for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AADDS = fromString("AADDS"); + + /** Static value AD for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AD = fromString("AD"); + + /** Static value AADKERB for DirectoryServiceOptions. */ + public static final DirectoryServiceOptions AADKERB = fromString("AADKERB"); + + /** + * Creates or finds a DirectoryServiceOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DirectoryServiceOptions. + */ + @JsonCreator + public static DirectoryServiceOptions fromString(String name) { + return fromString(name, DirectoryServiceOptions.class); + } + + /** + * Gets known DirectoryServiceOptions values. + * + * @return known DirectoryServiceOptions values. + */ + public static Collection values() { + return values(DirectoryServiceOptions.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java new file mode 100644 index 0000000000000..1e57865329678 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DnsEndpointType. */ +public final class DnsEndpointType extends ExpandableStringEnum { + /** Static value Standard for DnsEndpointType. */ + public static final DnsEndpointType STANDARD = fromString("Standard"); + + /** Static value AzureDnsZone for DnsEndpointType. */ + public static final DnsEndpointType AZURE_DNS_ZONE = fromString("AzureDnsZone"); + + /** + * Creates or finds a DnsEndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsEndpointType. + */ + @JsonCreator + public static DnsEndpointType fromString(String name) { + return fromString(name, DnsEndpointType.class); + } + + /** + * Gets known DnsEndpointType values. + * + * @return known DnsEndpointType values. + */ + public static Collection values() { + return values(DnsEndpointType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java new file mode 100644 index 0000000000000..b5c00a7fbfbcd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnabledProtocols. */ +public final class EnabledProtocols extends ExpandableStringEnum { + /** Static value SMB for EnabledProtocols. */ + public static final EnabledProtocols SMB = fromString("SMB"); + + /** Static value NFS for EnabledProtocols. */ + public static final EnabledProtocols NFS = fromString("NFS"); + + /** + * Creates or finds a EnabledProtocols from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledProtocols. + */ + @JsonCreator + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** + * Gets known EnabledProtocols values. + * + * @return known EnabledProtocols values. + */ + public static Collection values() { + return values(EnabledProtocols.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java new file mode 100644 index 0000000000000..95c0b501bef9d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The encryption settings on the storage account. */ +@Fluent +public final class Encryption { + /* + * List of services which support encryption. + */ + @JsonProperty(value = "services") + private EncryptionServices services; + + /* + * The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + */ + @JsonProperty(value = "keySource") + private KeySource keySource; + + /* + * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed + * keys for data at rest. + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /* + * Properties provided by key vault. + */ + @JsonProperty(value = "keyvaultproperties") + private KeyVaultProperties keyVaultProperties; + + /* + * The identity to be used with service-side encryption at rest. + */ + @JsonProperty(value = "identity") + private EncryptionIdentity encryptionIdentity; + + /** + * Get the services property: List of services which support encryption. + * + * @return the services value. + */ + public EncryptionServices services() { + return this.services; + } + + /** + * Set the services property: List of services which support encryption. + * + * @param services the services value to set. + * @return the Encryption object itself. + */ + public Encryption withServices(EncryptionServices services) { + this.services = services; + return this; + } + + /** + * Get the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. + * + * @param keySource the keySource value to set. + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Get the keyVaultProperties property: Properties provided by key vault. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @return the encryptionIdentity value. + */ + public EncryptionIdentity encryptionIdentity() { + return this.encryptionIdentity; + } + + /** + * Set the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @param encryptionIdentity the encryptionIdentity value to set. + * @return the Encryption object itself. + */ + public Encryption withEncryptionIdentity(EncryptionIdentity encryptionIdentity) { + this.encryptionIdentity = encryptionIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (services() != null) { + services().validate(); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (encryptionIdentity() != null) { + encryptionIdentity().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java new file mode 100644 index 0000000000000..357434647e464 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption identity for the storage account. */ +@Fluent +public class EncryptionIdentity { + /* + * Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage + * account. + */ + @JsonProperty(value = "userAssignedIdentity") + private String encryptionUserAssignedIdentity; + + /* + * 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. + */ + @JsonProperty(value = "federatedIdentityClientId") + private String encryptionFederatedIdentityClientId; + + /** + * Get the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the storage account. + * + * @return the encryptionUserAssignedIdentity value. + */ + public String encryptionUserAssignedIdentity() { + return this.encryptionUserAssignedIdentity; + } + + /** + * Set the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the storage account. + * + * @param encryptionUserAssignedIdentity the encryptionUserAssignedIdentity value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withEncryptionUserAssignedIdentity(String encryptionUserAssignedIdentity) { + this.encryptionUserAssignedIdentity = encryptionUserAssignedIdentity; + return this; + } + + /** + * Get the encryptionFederatedIdentityClientId property: 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. + * + * @return the encryptionFederatedIdentityClientId value. + */ + public String encryptionFederatedIdentityClientId() { + return this.encryptionFederatedIdentityClientId; + } + + /** + * Set the encryptionFederatedIdentityClientId property: 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. + * + * @param encryptionFederatedIdentityClientId the encryptionFederatedIdentityClientId value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withEncryptionFederatedIdentityClientId(String encryptionFederatedIdentityClientId) { + this.encryptionFederatedIdentityClientId = encryptionFederatedIdentityClientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java new file mode 100644 index 0000000000000..b4d6c05e015ce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of EncryptionScope. */ +public interface EncryptionScope { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + EncryptionScopeSource source(); + + /** + * Gets the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, + * Disabled. + * + * @return the state value. + */ + EncryptionScopeState state(); + + /** + * Gets the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + EncryptionScopeKeyVaultProperties keyVaultProperties(); + + /** + * Gets the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + Boolean requireInfrastructureEncryption(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner object. + * + * @return the inner object. + */ + EncryptionScopeInner innerModel(); + + /** The entirety of the EncryptionScope definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The EncryptionScope definition stages. */ + interface DefinitionStages { + /** The first stage of the EncryptionScope definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the EncryptionScope definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the EncryptionScope definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithSource, + DefinitionStages.WithState, + DefinitionStages.WithKeyVaultProperties, + DefinitionStages.WithRequireInfrastructureEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + EncryptionScope create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EncryptionScope create(Context context); + } + /** The stage of the EncryptionScope definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault.. + * + * @param source The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * @return the next definition stage. + */ + WithCreate withSource(EncryptionScopeSource source); + } + /** The stage of the EncryptionScope definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled.. + * + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * @return the next definition stage. + */ + WithCreate withState(EncryptionScopeState state); + } + /** The stage of the EncryptionScope definition allowing to specify keyVaultProperties. */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: The key vault properties for the encryption scope. This is a + * required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'.. + * + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if + * encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * @return the next definition stage. + */ + WithCreate withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + /** The stage of the EncryptionScope definition allowing to specify requireInfrastructureEncryption. */ + interface WithRequireInfrastructureEncryption { + /** + * Specifies the requireInfrastructureEncryption property: A boolean indicating whether or not the service + * applies a secondary layer of encryption with platform managed keys for data at rest.. + * + * @param requireInfrastructureEncryption A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * @return the next definition stage. + */ + WithCreate withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption); + } + } + /** + * Begins update for the EncryptionScope resource. + * + * @return the stage of resource update. + */ + EncryptionScope.Update update(); + + /** The template for EncryptionScope update. */ + interface Update + extends UpdateStages.WithSource, + UpdateStages.WithState, + UpdateStages.WithKeyVaultProperties, + UpdateStages.WithRequireInfrastructureEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EncryptionScope apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EncryptionScope apply(Context context); + } + /** The EncryptionScope update stages. */ + interface UpdateStages { + /** The stage of the EncryptionScope update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault.. + * + * @param source The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * @return the next definition stage. + */ + Update withSource(EncryptionScopeSource source); + } + /** The stage of the EncryptionScope update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled.. + * + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * @return the next definition stage. + */ + Update withState(EncryptionScopeState state); + } + /** The stage of the EncryptionScope update allowing to specify keyVaultProperties. */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: The key vault properties for the encryption scope. This is a + * required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'.. + * + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if + * encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * @return the next definition stage. + */ + Update withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + /** The stage of the EncryptionScope update allowing to specify requireInfrastructureEncryption. */ + interface WithRequireInfrastructureEncryption { + /** + * Specifies the requireInfrastructureEncryption property: A boolean indicating whether or not the service + * applies a secondary layer of encryption with platform managed keys for data at rest.. + * + * @param requireInfrastructureEncryption A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * @return the next definition stage. + */ + Update withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EncryptionScope refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EncryptionScope refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java new file mode 100644 index 0000000000000..f46b78f5428c4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + * set to 'Microsoft.KeyVault'. + */ +@Fluent +public final class EncryptionScopeKeyVaultProperties { + /* + * 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. + */ + @JsonProperty(value = "keyUri") + private String keyUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * Get the keyUri property: 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. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: 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. + * + * @param keyUri the keyUri value to set. + * @return the EncryptionScopeKeyVaultProperties object itself. + */ + public EncryptionScopeKeyVaultProperties withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in + * use. + * + * @return the currentVersionedKeyIdentifier value. + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java new file mode 100644 index 0000000000000..e0b141da9c27c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. */ +@Immutable +public final class EncryptionScopeListResult { + /* + * List of encryption scopes requested. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of encryption scopes requested. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java new file mode 100644 index 0000000000000..de7e7bee59b89 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionScopeSource. */ +public final class EncryptionScopeSource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for EncryptionScopeSource. */ + public static final EncryptionScopeSource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.KeyVault for EncryptionScopeSource. */ + public static final EncryptionScopeSource MICROSOFT_KEY_VAULT = fromString("Microsoft.KeyVault"); + + /** + * Creates or finds a EncryptionScopeSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeSource. + */ + @JsonCreator + public static EncryptionScopeSource fromString(String name) { + return fromString(name, EncryptionScopeSource.class); + } + + /** + * Gets known EncryptionScopeSource values. + * + * @return known EncryptionScopeSource values. + */ + public static Collection values() { + return values(EncryptionScopeSource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java new file mode 100644 index 0000000000000..a340c10f20ef3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionScopeState. */ +public final class EncryptionScopeState extends ExpandableStringEnum { + /** Static value Enabled for EncryptionScopeState. */ + public static final EncryptionScopeState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EncryptionScopeState. */ + public static final EncryptionScopeState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EncryptionScopeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeState. + */ + @JsonCreator + public static EncryptionScopeState fromString(String name) { + return fromString(name, EncryptionScopeState.class); + } + + /** + * Gets known EncryptionScopeState values. + * + * @return known EncryptionScopeState values. + */ + public static Collection values() { + return values(EncryptionScopeState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java new file mode 100644 index 0000000000000..110f5e539dbd6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EncryptionScopes. */ +public interface EncryptionScopes { + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource. + */ + EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context context); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Returns the properties for the specified encryption scope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + EncryptionScope getById(String id); + + /** + * Returns the properties for the specified encryption scope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EncryptionScope resource. + * + * @param name resource name. + * @return the first stage of the new EncryptionScope definition. + */ + EncryptionScope.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java new file mode 100644 index 0000000000000..42e1c819b3ccc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A service that allows server-side encryption to be used. */ +@Fluent +public final class EncryptionService { + /* + * 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. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastEnabledTime; + + /* + * 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. + */ + @JsonProperty(value = "keyType") + private KeyType keyType; + + /** + * Get the enabled property: 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. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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. + * + * @param enabled the enabled value to set. + * @return the EncryptionService object itself. + */ + public EncryptionService withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastEnabledTime property: 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. + * + * @return the lastEnabledTime value. + */ + public OffsetDateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get the keyType property: 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. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: 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. + * + * @param keyType the keyType value to set. + * @return the EncryptionService object itself. + */ + public EncryptionService withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java new file mode 100644 index 0000000000000..3bd047e60573d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A list of services that support encryption. */ +@Fluent +public final class EncryptionServices { + /* + * The encryption function of the blob storage service. + */ + @JsonProperty(value = "blob") + private EncryptionService blob; + + /* + * The encryption function of the file storage service. + */ + @JsonProperty(value = "file") + private EncryptionService file; + + /* + * The encryption function of the table storage service. + */ + @JsonProperty(value = "table") + private EncryptionService table; + + /* + * The encryption function of the queue storage service. + */ + @JsonProperty(value = "queue") + private EncryptionService queue; + + /** + * Get the blob property: The encryption function of the blob storage service. + * + * @return the blob value. + */ + public EncryptionService blob() { + return this.blob; + } + + /** + * Set the blob property: The encryption function of the blob storage service. + * + * @param blob the blob value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withBlob(EncryptionService blob) { + this.blob = blob; + return this; + } + + /** + * Get the file property: The encryption function of the file storage service. + * + * @return the file value. + */ + public EncryptionService file() { + return this.file; + } + + /** + * Set the file property: The encryption function of the file storage service. + * + * @param file the file value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withFile(EncryptionService file) { + this.file = file; + return this; + } + + /** + * Get the table property: The encryption function of the table storage service. + * + * @return the table value. + */ + public EncryptionService table() { + return this.table; + } + + /** + * Set the table property: The encryption function of the table storage service. + * + * @param table the table value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withTable(EncryptionService table) { + this.table = table; + return this; + } + + /** + * Get the queue property: The encryption function of the queue storage service. + * + * @return the queue value. + */ + public EncryptionService queue() { + return this.queue; + } + + /** + * Set the queue property: The encryption function of the queue storage service. + * + * @param queue the queue value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withQueue(EncryptionService queue) { + this.queue = queue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blob() != null) { + blob().validate(); + } + if (file() != null) { + file().validate(); + } + if (table() != null) { + table().validate(); + } + if (queue() != null) { + queue().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java new file mode 100644 index 0000000000000..412402011ac09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. */ +@Fluent +public final class Endpoints { + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /* + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /* + * Gets the microsoft routing storage endpoints. + */ + @JsonProperty(value = "microsoftEndpoints") + private StorageAccountMicrosoftEndpoints microsoftEndpoints; + + /* + * Gets the internet routing storage endpoints + */ + @JsonProperty(value = "internetEndpoints") + private StorageAccountInternetEndpoints internetEndpoints; + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the queue property: Gets the queue endpoint. + * + * @return the queue value. + */ + public String queue() { + return this.queue; + } + + /** + * Get the table property: Gets the table endpoint. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * Get the microsoftEndpoints property: Gets the microsoft routing storage endpoints. + * + * @return the microsoftEndpoints value. + */ + public StorageAccountMicrosoftEndpoints microsoftEndpoints() { + return this.microsoftEndpoints; + } + + /** + * Set the microsoftEndpoints property: Gets the microsoft routing storage endpoints. + * + * @param microsoftEndpoints the microsoftEndpoints value to set. + * @return the Endpoints object itself. + */ + public Endpoints withMicrosoftEndpoints(StorageAccountMicrosoftEndpoints microsoftEndpoints) { + this.microsoftEndpoints = microsoftEndpoints; + return this; + } + + /** + * Get the internetEndpoints property: Gets the internet routing storage endpoints. + * + * @return the internetEndpoints value. + */ + public StorageAccountInternetEndpoints internetEndpoints() { + return this.internetEndpoints; + } + + /** + * Set the internetEndpoints property: Gets the internet routing storage endpoints. + * + * @param internetEndpoints the internetEndpoints value to set. + * @return the Endpoints object itself. + */ + public Endpoints withInternetEndpoints(StorageAccountInternetEndpoints internetEndpoints) { + this.internetEndpoints = internetEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftEndpoints() != null) { + microsoftEndpoints().validate(); + } + if (internetEndpoints() != null) { + internetEndpoints().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java new file mode 100644 index 0000000000000..1aff6bea64751 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpirationAction. */ +public final class ExpirationAction extends ExpandableStringEnum { + /** Static value Log for ExpirationAction. */ + public static final ExpirationAction LOG = fromString("Log"); + + /** + * Creates or finds a ExpirationAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpirationAction. + */ + @JsonCreator + public static ExpirationAction fromString(String name) { + return fromString(name, ExpirationAction.class); + } + + /** + * Gets known ExpirationAction values. + * + * @return known ExpirationAction values. + */ + public static Collection values() { + return values(ExpirationAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..ded5937da267f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..e62cabd880cbb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java new file mode 100644 index 0000000000000..f49e2c81c4eaf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import java.util.List; + +/** An immutable client-side representation of FileServiceItems. */ +public interface FileServiceItems { + /** + * Gets the value property: List of file services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner object. + * + * @return the inner object. + */ + FileServiceItemsInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java new file mode 100644 index 0000000000000..500760a96b0d1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; + +/** An immutable client-side representation of FileServiceProperties. */ +public interface FileServiceProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the sku property: Sku name and tier. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the cors property: 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. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy shareDeleteRetentionPolicy(); + + /** + * Gets the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + ProtocolSettings protocolSettings(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner object. + * + * @return the inner object. + */ + FileServicePropertiesInner innerModel(); + + /** The entirety of the FileServiceProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FileServiceProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the FileServiceProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FileServiceProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the FileServiceProperties definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithCors, + DefinitionStages.WithShareDeleteRetentionPolicy, + DefinitionStages.WithProtocolSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileServiceProperties create(Context context); + } + /** The stage of the FileServiceProperties definition allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + /** The stage of the FileServiceProperties definition allowing to specify shareDeleteRetentionPolicy. */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies the shareDeleteRetentionPolicy property: The file service properties for share soft delete.. + * + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @return the next definition stage. + */ + WithCreate withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + /** The stage of the FileServiceProperties definition allowing to specify protocolSettings. */ + interface WithProtocolSettings { + /** + * Specifies the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings Protocol settings for file service. + * @return the next definition stage. + */ + WithCreate withProtocolSettings(ProtocolSettings protocolSettings); + } + } + /** + * Begins update for the FileServiceProperties resource. + * + * @return the stage of resource update. + */ + FileServiceProperties.Update update(); + + /** The template for FileServiceProperties update. */ + interface Update + extends UpdateStages.WithCors, UpdateStages.WithShareDeleteRetentionPolicy, UpdateStages.WithProtocolSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileServiceProperties apply(Context context); + } + /** The FileServiceProperties update stages. */ + interface UpdateStages { + /** The stage of the FileServiceProperties update allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + /** The stage of the FileServiceProperties update allowing to specify shareDeleteRetentionPolicy. */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies the shareDeleteRetentionPolicy property: The file service properties for share soft delete.. + * + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @return the next definition stage. + */ + Update withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + /** The stage of the FileServiceProperties update allowing to specify protocolSettings. */ + interface WithProtocolSettings { + /** + * Specifies the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings Protocol settings for file service. + * @return the next definition stage. + */ + Update withProtocolSettings(ProtocolSettings protocolSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java new file mode 100644 index 0000000000000..f7d242fe8a41a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FileServices. */ +public interface FileServices { + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + FileServiceItems list(String resourceGroupName, String accountName); + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + FileServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + FileServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FileServiceProperties resource. + * + * @return the first stage of the new FileServiceProperties definition. + */ + FileServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java new file mode 100644 index 0000000000000..cb07b62b271b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FileShare. */ +public interface FileShare { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the shareQuota property: 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. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * Gets the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * Gets the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * Gets the version property: The version of the share. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * Gets the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + OffsetDateTime accessTierChangeTime(); + + /** + * Gets the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * Gets the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * Gets the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + OffsetDateTime snapshotTime(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner object. + * + * @return the inner object. + */ + FileShareInner innerModel(); + + /** The entirety of the FileShare definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FileShare definition stages. */ + interface DefinitionStages { + /** The first stage of the FileShare definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FileShare definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the FileShare definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithMetadata, + DefinitionStages.WithShareQuota, + DefinitionStages.WithEnabledProtocols, + DefinitionStages.WithRootSquash, + DefinitionStages.WithAccessTier, + DefinitionStages.WithSignedIdentifiers, + DefinitionStages.WithExpand { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileShare create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileShare create(Context context); + } + /** The stage of the FileShare definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the share as metadata.. + * + * @param metadata A name-value pair to associate with the share as metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + /** The stage of the FileShare definition allowing to specify shareQuota. */ + interface WithShareQuota { + /** + * Specifies the shareQuota property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withShareQuota(Integer shareQuota); + } + /** The stage of the FileShare definition allowing to specify enabledProtocols. */ + interface WithEnabledProtocols { + /** + * Specifies the enabledProtocols property: The authentication protocol that is used for the file share. Can + * only be specified when creating a share.. + * + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * @return the next definition stage. + */ + WithCreate withEnabledProtocols(EnabledProtocols enabledProtocols); + } + /** The stage of the FileShare definition allowing to specify rootSquash. */ + interface WithRootSquash { + /** + * Specifies the rootSquash property: The property is for NFS share only. The default is NoRootSquash.. + * + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. + * @return the next definition stage. + */ + WithCreate withRootSquash(RootSquashType rootSquash); + } + /** The stage of the FileShare definition allowing to specify accessTier. */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.. + * + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * @return the next definition stage. + */ + WithCreate withAccessTier(ShareAccessTier accessTier); + } + /** The stage of the FileShare definition allowing to specify signedIdentifiers. */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the share.. + * + * @param signedIdentifiers List of stored access policies specified on the share. + * @return the next definition stage. + */ + WithCreate withSignedIdentifiers(List signedIdentifiers); + } + /** The stage of the FileShare definition allowing to specify expand. */ + interface WithExpand { + /** + * Specifies the expand property: Optional, used to expand the properties within share's properties. Valid + * values are: snapshots. Should be passed as a string with delimiter ','. + * + * @param expand Optional, used to expand the properties within share's properties. Valid values are: + * snapshots. Should be passed as a string with delimiter ','. + * @return the next definition stage. + */ + WithCreate withExpand(String expand); + } + } + /** + * Begins update for the FileShare resource. + * + * @return the stage of resource update. + */ + FileShare.Update update(); + + /** The template for FileShare update. */ + interface Update + extends UpdateStages.WithMetadata, + UpdateStages.WithShareQuota, + UpdateStages.WithRootSquash, + UpdateStages.WithAccessTier, + UpdateStages.WithSignedIdentifiers { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileShare apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileShare apply(Context context); + } + /** The FileShare update stages. */ + interface UpdateStages { + /** The stage of the FileShare update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the share as metadata.. + * + * @param metadata A name-value pair to associate with the share as metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + /** The stage of the FileShare update allowing to specify shareQuota. */ + interface WithShareQuota { + /** + * Specifies the shareQuota property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withShareQuota(Integer shareQuota); + } + /** The stage of the FileShare update allowing to specify rootSquash. */ + interface WithRootSquash { + /** + * Specifies the rootSquash property: The property is for NFS share only. The default is NoRootSquash.. + * + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. + * @return the next definition stage. + */ + Update withRootSquash(RootSquashType rootSquash); + } + /** The stage of the FileShare update allowing to specify accessTier. */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.. + * + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * @return the next definition stage. + */ + Update withAccessTier(ShareAccessTier accessTier); + } + /** The stage of the FileShare update allowing to specify signedIdentifiers. */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the share.. + * + * @param signedIdentifiers List of stored access policies specified on the share. + * @return the next definition stage. + */ + Update withSignedIdentifiers(List signedIdentifiers); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileShare refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileShare refresh(Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restore(DeletedShare deletedShare); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param deletedShare The deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response restoreWithResponse(DeletedShare deletedShare, Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + LeaseShareResponse lease(); + + /** + * 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. + * + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + Response leaseWithResponse(String xMsSnapshot, LeaseShareRequest parameters, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java new file mode 100644 index 0000000000000..f88b7e349eb59 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of FileShareItem. */ +public interface FileShareItem { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the shareQuota property: 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. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * Gets the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * Gets the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * Gets the version property: The version of the share. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * Gets the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + OffsetDateTime accessTierChangeTime(); + + /** + * Gets the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * Gets the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * Gets the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + OffsetDateTime snapshotTime(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner object. + * + * @return the inner object. + */ + FileShareItemInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java new file mode 100644 index 0000000000000..37e25cc952679 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of + * shares. + */ +@Immutable +public final class FileShareItems { + /* + * List of file shares returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed + * maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of file shares returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of shares. Returned when total number + * of requested shares exceed maximum page size. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java new file mode 100644 index 0000000000000..9690ed92fb3a0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FileShares. */ +public interface FileShares { + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + String expand, + Context context); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share. + */ + FileShare get(String resourceGroupName, String accountName, String shareName); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + Context context); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String shareName); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + LeaseShareResponse lease(String resourceGroupName, String accountName, String shareName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + Response leaseWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters, + Context context); + + /** + * Gets properties of a specified share. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response}. + */ + FileShare getById(String id); + + /** + * Gets properties of a specified share. + * + * @param id the resource ID. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response}. + */ + Response getByIdWithResponse(String id, String expand, String xMsSnapshot, Context context); + + /** + * Deletes specified share under its account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specified share under its account. + * + * @param id the resource ID. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, String xMsSnapshot, String include, Context context); + + /** + * Begins definition for a new FileShare resource. + * + * @param name resource name. + * @return the first stage of the new FileShare definition. + */ + FileShare.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java new file mode 100644 index 0000000000000..e68163bd9c16a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FileSharesLeaseHeaders model. */ +@Fluent +public final class FileSharesLeaseHeaders { + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String etag; + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the FileSharesLeaseHeaders object itself. + */ + public FileSharesLeaseHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java new file mode 100644 index 0000000000000..10e91a92683b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; + +/** Contains all response data for the lease operation. */ +public final class FileSharesLeaseResponse extends ResponseBase { + /** + * Creates an instance of FileSharesLeaseResponse. + * + * @param request the request which resulted in this FileSharesLeaseResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public FileSharesLeaseResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LeaseShareResponseInner value, + FileSharesLeaseHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public LeaseShareResponseInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java new file mode 100644 index 0000000000000..95033e82da7c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Format. */ +public final class Format extends ExpandableStringEnum { + /** Static value Csv for Format. */ + public static final Format CSV = fromString("Csv"); + + /** Static value Parquet for Format. */ + public static final Format PARQUET = fromString("Parquet"); + + /** + * Creates or finds a Format from its string representation. + * + * @param name a name to look for. + * @return the corresponding Format. + */ + @JsonCreator + public static Format fromString(String name) { + return fromString(name, Format.class); + } + + /** + * Gets known Format values. + * + * @return known Format values. + */ + public static Collection values() { + return values(Format.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java new file mode 100644 index 0000000000000..47c8aa3b3e17f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * 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. + */ +@Immutable +public final class GeoReplicationStats { + /* + * 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. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStatus status; + + /* + * 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. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTime; + + /* + * A boolean flag which indicates whether or not account failover is supported for the account. + */ + @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canFailover; + + /** + * Get the status property: 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. + * + * @return the status value. + */ + public GeoReplicationStatus status() { + return this.status; + } + + /** + * Get the lastSyncTime property: 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. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get the canFailover property: A boolean flag which indicates whether or not account failover is supported for the + * account. + * + * @return the canFailover value. + */ + public Boolean canFailover() { + return this.canFailover; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java new file mode 100644 index 0000000000000..0fb3ed7d9ffc9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GeoReplicationStatus. */ +public final class GeoReplicationStatus extends ExpandableStringEnum { + /** Static value Live for GeoReplicationStatus. */ + public static final GeoReplicationStatus LIVE = fromString("Live"); + + /** Static value Bootstrap for GeoReplicationStatus. */ + public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); + + /** Static value Unavailable for GeoReplicationStatus. */ + public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a GeoReplicationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoReplicationStatus. + */ + @JsonCreator + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** + * Gets known GeoReplicationStatus values. + * + * @return known GeoReplicationStatus values. + */ + public static Collection values() { + return values(GeoReplicationStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java new file mode 100644 index 0000000000000..b930633866cb3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HttpProtocol. */ +public enum HttpProtocol { + /** Enum value https,http. */ + HTTPS_HTTP("https,http"), + + /** Enum value https. */ + HTTPS("https"); + + /** The actual serialized value for a HttpProtocol instance. */ + private final String value; + + HttpProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpProtocol object, or null if unable to parse. + */ + @JsonCreator + public static HttpProtocol fromString(String value) { + if (value == null) { + return null; + } + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java new file mode 100644 index 0000000000000..aa2df4c80d2f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /* + * 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. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: 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. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: 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. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Identity.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java new file mode 100644 index 0000000000000..c6b19d8f66102 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityType. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * Gets known IdentityType values. + * + * @return known IdentityType values. + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java new file mode 100644 index 0000000000000..1473a6108437b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** An immutable client-side representation of ImmutabilityPolicy. */ +public interface ImmutabilityPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + Integer immutabilityPeriodSinceCreationInDays(); + + /** + * Gets the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + ImmutabilityPolicyState state(); + + /** + * Gets the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + Boolean allowProtectedAppendWrites(); + + /** + * Gets the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + Boolean allowProtectedAppendWritesAll(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner object. + * + * @return the inner object. + */ + ImmutabilityPolicyInner innerModel(); + + /** The entirety of the ImmutabilityPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ImmutabilityPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ImmutabilityPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ImmutabilityPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, containerName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container + * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) + * only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @return the next definition stage. + */ + WithCreate withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + /** + * The stage of the ImmutabilityPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithImmutabilityPeriodSinceCreationInDays, + DefinitionStages.WithAllowProtectedAppendWrites, + DefinitionStages.WithAllowProtectedAppendWritesAll, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ImmutabilityPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ImmutabilityPolicy create(Context context); + } + /** The stage of the ImmutabilityPolicy definition allowing to specify immutabilityPeriodSinceCreationInDays. */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in + * the container since the policy creation, in days.. + * + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since + * the policy creation, in days. + * @return the next definition stage. + */ + WithCreate withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + /** The stage of the ImmutabilityPolicy definition allowing to specify allowProtectedAppendWrites. */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies the allowProtectedAppendWrites property: 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.. + * + * @param allowProtectedAppendWrites 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. + * @return the next definition stage. + */ + WithCreate withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + /** The stage of the ImmutabilityPolicy definition allowing to specify allowProtectedAppendWritesAll. */ + interface WithAllowProtectedAppendWritesAll { + /** + * Specifies the allowProtectedAppendWritesAll property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll); + } + /** The stage of the ImmutabilityPolicy definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the ImmutabilityPolicy resource. + * + * @return the stage of resource update. + */ + ImmutabilityPolicy.Update update(); + + /** The template for ImmutabilityPolicy update. */ + interface Update + extends UpdateStages.WithImmutabilityPeriodSinceCreationInDays, + UpdateStages.WithAllowProtectedAppendWrites, + UpdateStages.WithAllowProtectedAppendWritesAll, + UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ImmutabilityPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ImmutabilityPolicy apply(Context context); + } + /** The ImmutabilityPolicy update stages. */ + interface UpdateStages { + /** The stage of the ImmutabilityPolicy update allowing to specify immutabilityPeriodSinceCreationInDays. */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in + * the container since the policy creation, in days.. + * + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since + * the policy creation, in days. + * @return the next definition stage. + */ + Update withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + /** The stage of the ImmutabilityPolicy update allowing to specify allowProtectedAppendWrites. */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies the allowProtectedAppendWrites property: 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.. + * + * @param allowProtectedAppendWrites 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. + * @return the next definition stage. + */ + Update withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + /** The stage of the ImmutabilityPolicy update allowing to specify allowProtectedAppendWritesAll. */ + interface WithAllowProtectedAppendWritesAll { + /** + * Specifies the allowProtectedAppendWritesAll property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll); + } + /** The stage of the ImmutabilityPolicy update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ImmutabilityPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ImmutabilityPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..e66ed8569e0ae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyProperty; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an ImmutabilityPolicy of a blob container. */ +@Fluent +public final class ImmutabilityPolicyProperties { + /* + * The properties of an ImmutabilityPolicy of a blob container. + */ + @JsonProperty(value = "properties") + private ImmutabilityPolicyProperty innerProperties; + + /* + * ImmutabilityPolicy Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The ImmutabilityPolicy update history of the blob container. + */ + @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) + private List updateHistory; + + /** + * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. + * + * @return the innerProperties value. + */ + private ImmutabilityPolicyProperty innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: ImmutabilityPolicy Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the updateHistory property: The ImmutabilityPolicy update history of the blob container. + * + * @return the updateHistory value. + */ + public List updateHistory() { + return this.updateHistory; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withImmutabilityPeriodSinceCreationInDays( + Integer immutabilityPeriodSinceCreationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); + } + + /** + * Set the allowProtectedAppendWrites property: 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. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWritesAll(); + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (updateHistory() != null) { + updateHistory().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java new file mode 100644 index 0000000000000..000dbc24d2bc8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImmutabilityPolicyState. */ +public final class ImmutabilityPolicyState extends ExpandableStringEnum { + /** Static value Locked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** Static value Unlocked for ImmutabilityPolicyState. */ + public static final ImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a ImmutabilityPolicyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyState. + */ + @JsonCreator + public static ImmutabilityPolicyState fromString(String name) { + return fromString(name, ImmutabilityPolicyState.class); + } + + /** + * Gets known ImmutabilityPolicyState values. + * + * @return known ImmutabilityPolicyState values. + */ + public static Collection values() { + return values(ImmutabilityPolicyState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java new file mode 100644 index 0000000000000..4e780bd3ab9f9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImmutabilityPolicyUpdateType. */ +public final class ImmutabilityPolicyUpdateType extends ExpandableStringEnum { + /** Static value put for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType PUT = fromString("put"); + + /** Static value lock for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType LOCK = fromString("lock"); + + /** Static value extend for ImmutabilityPolicyUpdateType. */ + public static final ImmutabilityPolicyUpdateType EXTEND = fromString("extend"); + + /** + * Creates or finds a ImmutabilityPolicyUpdateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyUpdateType. + */ + @JsonCreator + public static ImmutabilityPolicyUpdateType fromString(String name) { + return fromString(name, ImmutabilityPolicyUpdateType.class); + } + + /** + * Gets known ImmutabilityPolicyUpdateType values. + * + * @return known ImmutabilityPolicyUpdateType values. + */ + public static Collection values() { + return values(ImmutabilityPolicyUpdateType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java new file mode 100644 index 0000000000000..8123e04f6e378 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. */ +@Fluent +public final class ImmutableStorageAccount { + /* + * A boolean flag which enables account-level immutability. All the containers under such an account have + * object-level immutability enabled by default. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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. + */ + @JsonProperty(value = "immutabilityPolicy") + private AccountImmutabilityPolicyProperties immutabilityPolicy; + + /** + * Get the enabled property: A boolean flag which enables account-level immutability. All the containers under such + * an account have object-level immutability enabled by default. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A boolean flag which enables account-level immutability. All the containers under such + * an account have object-level immutability enabled by default. + * + * @param enabled the enabled value to set. + * @return the ImmutableStorageAccount object itself. + */ + public ImmutableStorageAccount withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the immutabilityPolicy property: 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. + * + * @return the immutabilityPolicy value. + */ + public AccountImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Set the immutabilityPolicy property: 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. + * + * @param immutabilityPolicy the immutabilityPolicy value to set. + * @return the ImmutableStorageAccount object itself. + */ + public ImmutableStorageAccount withImmutabilityPolicy(AccountImmutabilityPolicyProperties immutabilityPolicy) { + this.immutabilityPolicy = immutabilityPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java new file mode 100644 index 0000000000000..d139ffd136b2e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Object level immutability properties of the container. */ +@Fluent +public final class ImmutableStorageWithVersioning { + /* + * This is an immutable property, when set to true it enables object level immutability at the container level. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Returns the date and time the object level immutability was enabled. + */ + @JsonProperty(value = "timeStamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * This property denotes the container level immutability to object level immutability migration state. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState migrationState; + + /** + * Get the enabled property: This is an immutable property, when set to true it enables object level immutability at + * the container level. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: This is an immutable property, when set to true it enables object level immutability at + * the container level. + * + * @param enabled the enabled value to set. + * @return the ImmutableStorageWithVersioning object itself. + */ + public ImmutableStorageWithVersioning withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the timestamp property: Returns the date and time the object level immutability was enabled. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the migrationState property: This property denotes the container level immutability to object level + * immutability migration state. + * + * @return the migrationState value. + */ + public MigrationState migrationState() { + return this.migrationState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java new file mode 100644 index 0000000000000..ce31e123b3696 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InventoryRuleType. */ +public final class InventoryRuleType extends ExpandableStringEnum { + /** Static value Inventory for InventoryRuleType. */ + public static final InventoryRuleType INVENTORY = fromString("Inventory"); + + /** + * Creates or finds a InventoryRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryRuleType. + */ + @JsonCreator + public static InventoryRuleType fromString(String name) { + return fromString(name, InventoryRuleType.class); + } + + /** + * Gets known InventoryRuleType values. + * + * @return known InventoryRuleType values. + */ + public static Collection values() { + return values(InventoryRuleType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java new file mode 100644 index 0000000000000..660fccaab21ed --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP rule with specific IP or IP range in CIDR format. */ +@Fluent +public final class IpRule { + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + */ + @JsonProperty(value = "value", required = true) + private String ipAddressOrRange; + + /* + * The action of IP ACL rule. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the IpRule object itself. + */ + public IpRule withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the action property: The action of IP ACL rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of IP ACL rule. + * + * @param action the action value to set. + * @return the IpRule object itself. + */ + public IpRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressOrRange() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java new file mode 100644 index 0000000000000..c8fd64a61f181 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Storage account keys creation time. */ +@Fluent +public final class KeyCreationTime { + /* + * The key1 property. + */ + @JsonProperty(value = "key1") + private OffsetDateTime key1; + + /* + * The key2 property. + */ + @JsonProperty(value = "key2") + private OffsetDateTime key2; + + /** + * Get the key1 property: The key1 property. + * + * @return the key1 value. + */ + public OffsetDateTime key1() { + return this.key1; + } + + /** + * Set the key1 property: The key1 property. + * + * @param key1 the key1 value to set. + * @return the KeyCreationTime object itself. + */ + public KeyCreationTime withKey1(OffsetDateTime key1) { + this.key1 = key1; + return this; + } + + /** + * Get the key2 property: The key2 property. + * + * @return the key2 value. + */ + public OffsetDateTime key2() { + return this.key2; + } + + /** + * Set the key2 property: The key2 property. + * + * @param key2 the key2 value to set. + * @return the KeyCreationTime object itself. + */ + public KeyCreationTime withKey2(OffsetDateTime key2) { + this.key2 = key2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java new file mode 100644 index 0000000000000..07bb078e5625b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for KeyPermission. */ +public enum KeyPermission { + /** Enum value Read. */ + READ("Read"), + + /** Enum value Full. */ + FULL("Full"); + + /** The actual serialized value for a KeyPermission instance. */ + private final String value; + + KeyPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyPermission object, or null if unable to parse. + */ + @JsonCreator + public static KeyPermission fromString(String value) { + if (value == null) { + return null; + } + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java new file mode 100644 index 0000000000000..203da0eda2abb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KeyPolicy assigned to the storage account. */ +@Fluent +public final class KeyPolicy { + /* + * The key expiration period in days. + */ + @JsonProperty(value = "keyExpirationPeriodInDays", required = true) + private int keyExpirationPeriodInDays; + + /** + * Get the keyExpirationPeriodInDays property: The key expiration period in days. + * + * @return the keyExpirationPeriodInDays value. + */ + public int keyExpirationPeriodInDays() { + return this.keyExpirationPeriodInDays; + } + + /** + * Set the keyExpirationPeriodInDays property: The key expiration period in days. + * + * @param keyExpirationPeriodInDays the keyExpirationPeriodInDays value to set. + * @return the KeyPolicy object itself. + */ + public KeyPolicy withKeyExpirationPeriodInDays(int keyExpirationPeriodInDays) { + this.keyExpirationPeriodInDays = keyExpirationPeriodInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java new file mode 100644 index 0000000000000..374b58831ded7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeySource. */ +public final class KeySource extends ExpandableStringEnum { + /** Static value Microsoft.Storage for KeySource. */ + public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** Static value Microsoft.Keyvault for KeySource. */ + public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates or finds a KeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeySource. + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** + * Gets known KeySource values. + * + * @return known KeySource values. + */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java new file mode 100644 index 0000000000000..e135f4d927375 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeyType. */ +public final class KeyType extends ExpandableStringEnum { + /** Static value Service for KeyType. */ + public static final KeyType SERVICE = fromString("Service"); + + /** Static value Account for KeyType. */ + public static final KeyType ACCOUNT = fromString("Account"); + + /** + * Creates or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** + * Gets known KeyType values. + * + * @return known KeyType values. + */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..a1754ca36f057 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of key vault. */ +@Fluent +public final class KeyVaultProperties { + /* + * The name of KeyVault key. + */ + @JsonProperty(value = "keyname") + private String keyName; + + /* + * The version of KeyVault key. + */ + @JsonProperty(value = "keyversion") + private String keyVersion; + + /* + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyvaulturi") + private String keyVaultUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /* + * This is a read only property that represents the expiration time of the current version of the customer managed + * key used for encryption. + */ + @JsonProperty(value = "currentVersionedKeyExpirationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime currentVersionedKeyExpirationTimestamp; + + /** + * Get the keyName property: The name of KeyVault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of KeyVault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of KeyVault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of KeyVault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the keyVaultUri property: The Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in + * use. + * + * @return the currentVersionedKeyIdentifier value. + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Get the currentVersionedKeyExpirationTimestamp property: This is a read only property that represents the + * expiration time of the current version of the customer managed key used for encryption. + * + * @return the currentVersionedKeyExpirationTimestamp value. + */ + public OffsetDateTime currentVersionedKeyExpirationTimestamp() { + return this.currentVersionedKeyExpirationTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java new file mode 100644 index 0000000000000..015792336e6e4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Kind. */ +public final class Kind extends ExpandableStringEnum { + /** Static value Storage for Kind. */ + public static final Kind STORAGE = fromString("Storage"); + + /** Static value StorageV2 for Kind. */ + public static final Kind STORAGE_V2 = fromString("StorageV2"); + + /** Static value BlobStorage for Kind. */ + public static final Kind BLOB_STORAGE = fromString("BlobStorage"); + + /** Static value FileStorage for Kind. */ + public static final Kind FILE_STORAGE = fromString("FileStorage"); + + /** Static value BlockBlobStorage for Kind. */ + public static final Kind BLOCK_BLOB_STORAGE = fromString("BlockBlobStorage"); + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * Gets known Kind values. + * + * @return known Kind values. + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java new file mode 100644 index 0000000000000..eeebbfb54a57a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LargeFileSharesState. */ +public final class LargeFileSharesState extends ExpandableStringEnum { + /** Static value Disabled for LargeFileSharesState. */ + public static final LargeFileSharesState DISABLED = fromString("Disabled"); + + /** Static value Enabled for LargeFileSharesState. */ + public static final LargeFileSharesState ENABLED = fromString("Enabled"); + + /** + * Creates or finds a LargeFileSharesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LargeFileSharesState. + */ + @JsonCreator + public static LargeFileSharesState fromString(String name) { + return fromString(name, LargeFileSharesState.class); + } + + /** + * Gets known LargeFileSharesState values. + * + * @return known LargeFileSharesState values. + */ + public static Collection values() { + return values(LargeFileSharesState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java new file mode 100644 index 0000000000000..04d3c725bccb1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The blob service properties for Last access time based tracking policy. */ +@Fluent +public final class LastAccessTimeTrackingPolicy { + /* + * When set to true last access time based tracking is enabled. + */ + @JsonProperty(value = "enable", required = true) + private boolean enable; + + /* + * Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + */ + @JsonProperty(value = "name") + private Name 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 + */ + @JsonProperty(value = "trackingGranularityInDays") + private Integer trackingGranularityInDays; + + /* + * An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read + * only + */ + @JsonProperty(value = "blobType") + private List blobType; + + /** + * Get the enable property: When set to true last access time based tracking is enabled. + * + * @return the enable value. + */ + public boolean enable() { + return this.enable; + } + + /** + * Set the enable property: When set to true last access time based tracking is enabled. + * + * @param enable the enable value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withEnable(boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read + * only. + * + * @return the name value. + */ + public Name name() { + return this.name; + } + + /** + * Set the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read + * only. + * + * @param name the name value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withName(Name name) { + this.name = name; + return this; + } + + /** + * Get the trackingGranularityInDays property: 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. + * + * @return the trackingGranularityInDays value. + */ + public Integer trackingGranularityInDays() { + return this.trackingGranularityInDays; + } + + /** + * Set the trackingGranularityInDays property: 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. + * + * @param trackingGranularityInDays the trackingGranularityInDays value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withTrackingGranularityInDays(Integer trackingGranularityInDays) { + this.trackingGranularityInDays = trackingGranularityInDays; + return this; + } + + /** + * Get the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. + * This field is currently read only. + * + * @return the blobType value. + */ + public List blobType() { + return this.blobType; + } + + /** + * Set the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. + * This field is currently read only. + * + * @param blobType the blobType value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withBlobType(List blobType) { + this.blobType = blobType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java new file mode 100644 index 0000000000000..a8b356db009ce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Container request schema. */ +@Fluent +public final class LeaseContainerRequest { + /* + * Specifies the lease action. Can be one of the available actions. + */ + @JsonProperty(value = "action", required = true) + private LeaseContainerRequestAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, + * between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that + * never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get the action property: Specifies the lease action. Can be one of the available actions. + * + * @return the action value. + */ + public LeaseContainerRequestAction action() { + return this.action; + } + + /** + * Set the action property: Specifies the lease action. Can be one of the available actions. + * + * @param action the action value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(LeaseContainerRequestAction action) { + this.action = action; + return this; + } + + /** + * Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value. + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value. + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @return the proposedLeaseId value. + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @param proposedLeaseId the proposedLeaseId value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model LeaseContainerRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LeaseContainerRequest.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java new file mode 100644 index 0000000000000..24694e89694cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseContainerRequestAction. */ +public final class LeaseContainerRequestAction extends ExpandableStringEnum { + /** Static value Acquire for LeaseContainerRequestAction. */ + public static final LeaseContainerRequestAction ACQUIRE = fromString("Acquire"); + + /** Static value Renew for LeaseContainerRequestAction. */ + public static final LeaseContainerRequestAction RENEW = fromString("Renew"); + + /** Static value Change for LeaseContainerRequestAction. */ + public static final LeaseContainerRequestAction CHANGE = fromString("Change"); + + /** Static value Release for LeaseContainerRequestAction. */ + public static final LeaseContainerRequestAction RELEASE = fromString("Release"); + + /** Static value Break for LeaseContainerRequestAction. */ + public static final LeaseContainerRequestAction BREAK = fromString("Break"); + + /** + * Creates or finds a LeaseContainerRequestAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseContainerRequestAction. + */ + @JsonCreator + public static LeaseContainerRequestAction fromString(String name) { + return fromString(name, LeaseContainerRequestAction.class); + } + + /** + * Gets known LeaseContainerRequestAction values. + * + * @return known LeaseContainerRequestAction values. + */ + public static Collection values() { + return values(LeaseContainerRequestAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java new file mode 100644 index 0000000000000..197dddc327b73 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; + +/** An immutable client-side representation of LeaseContainerResponse. */ +public interface LeaseContainerResponse { + /** + * Gets the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + String leaseId(); + + /** + * Gets the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner object. + * + * @return the inner object. + */ + LeaseContainerResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java new file mode 100644 index 0000000000000..f2a0eebf0db98 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseDuration. */ +public final class LeaseDuration extends ExpandableStringEnum { + /** Static value Infinite for LeaseDuration. */ + public static final LeaseDuration INFINITE = fromString("Infinite"); + + /** Static value Fixed for LeaseDuration. */ + public static final LeaseDuration FIXED = fromString("Fixed"); + + /** + * Creates or finds a LeaseDuration from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseDuration. + */ + @JsonCreator + public static LeaseDuration fromString(String name) { + return fromString(name, LeaseDuration.class); + } + + /** + * Gets known LeaseDuration values. + * + * @return known LeaseDuration values. + */ + public static Collection values() { + return values(LeaseDuration.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java new file mode 100644 index 0000000000000..175f02ee0bf27 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseShareAction. */ +public final class LeaseShareAction extends ExpandableStringEnum { + /** Static value Acquire for LeaseShareAction. */ + public static final LeaseShareAction ACQUIRE = fromString("Acquire"); + + /** Static value Renew for LeaseShareAction. */ + public static final LeaseShareAction RENEW = fromString("Renew"); + + /** Static value Change for LeaseShareAction. */ + public static final LeaseShareAction CHANGE = fromString("Change"); + + /** Static value Release for LeaseShareAction. */ + public static final LeaseShareAction RELEASE = fromString("Release"); + + /** Static value Break for LeaseShareAction. */ + public static final LeaseShareAction BREAK = fromString("Break"); + + /** + * Creates or finds a LeaseShareAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseShareAction. + */ + @JsonCreator + public static LeaseShareAction fromString(String name) { + return fromString(name, LeaseShareAction.class); + } + + /** + * Gets known LeaseShareAction values. + * + * @return known LeaseShareAction values. + */ + public static Collection values() { + return values(LeaseShareAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java new file mode 100644 index 0000000000000..8d033f9dd7472 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Share request schema. */ +@Fluent +public final class LeaseShareRequest { + /* + * Specifies the lease action. Can be one of the available actions. + */ + @JsonProperty(value = "action", required = true) + private LeaseShareAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, + * between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that + * never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * Get the action property: Specifies the lease action. Can be one of the available actions. + * + * @return the action value. + */ + public LeaseShareAction action() { + return this.action; + } + + /** + * Set the action property: Specifies the lease action. Can be one of the available actions. + * + * @param action the action value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withAction(LeaseShareAction action) { + this.action = action; + return this; + } + + /** + * Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value. + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value. + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @return the proposedLeaseId value. + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @param proposedLeaseId the proposedLeaseId value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model LeaseShareRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LeaseShareRequest.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java new file mode 100644 index 0000000000000..5c606b97d261b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; + +/** An immutable client-side representation of LeaseShareResponse. */ +public interface LeaseShareResponse { + /** + * Gets the leaseId property: Returned unique lease ID that must be included with any request to delete the share, + * or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + String leaseId(); + + /** + * Gets the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner object. + * + * @return the inner object. + */ + LeaseShareResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java new file mode 100644 index 0000000000000..839bb5962d78a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseState. */ +public final class LeaseState extends ExpandableStringEnum { + /** Static value Available for LeaseState. */ + public static final LeaseState AVAILABLE = fromString("Available"); + + /** Static value Leased for LeaseState. */ + public static final LeaseState LEASED = fromString("Leased"); + + /** Static value Expired for LeaseState. */ + public static final LeaseState EXPIRED = fromString("Expired"); + + /** Static value Breaking for LeaseState. */ + public static final LeaseState BREAKING = fromString("Breaking"); + + /** Static value Broken for LeaseState. */ + public static final LeaseState BROKEN = fromString("Broken"); + + /** + * Creates or finds a LeaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseState. + */ + @JsonCreator + public static LeaseState fromString(String name) { + return fromString(name, LeaseState.class); + } + + /** + * Gets known LeaseState values. + * + * @return known LeaseState values. + */ + public static Collection values() { + return values(LeaseState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java new file mode 100644 index 0000000000000..10792cd03fb59 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseStatus. */ +public final class LeaseStatus extends ExpandableStringEnum { + /** Static value Locked for LeaseStatus. */ + public static final LeaseStatus LOCKED = fromString("Locked"); + + /** Static value Unlocked for LeaseStatus. */ + public static final LeaseStatus UNLOCKED = fromString("Unlocked"); + + /** + * Creates or finds a LeaseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseStatus. + */ + @JsonCreator + public static LeaseStatus fromString(String name) { + return fromString(name, LeaseStatus.class); + } + + /** + * Gets known LeaseStatus values. + * + * @return known LeaseStatus values. + */ + public static Collection values() { + return values(LeaseStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java new file mode 100644 index 0000000000000..82f3362dc99f1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.List; + +/** An immutable client-side representation of LegalHold. */ +public interface LegalHold { + /** + * Gets the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at + * SRP. + * + * @return the tags value. + */ + List tags(); + + /** + * Gets the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + Boolean allowProtectedAppendWritesAll(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner object. + * + * @return the inner object. + */ + LegalHoldInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java new file mode 100644 index 0000000000000..f154eb1b17c1d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LegalHold property of a blob container. */ +@Fluent +public final class 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. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /* + * The list of LegalHold tags of a blob container. + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * Protected append blob writes history. + */ + @JsonProperty(value = "protectedAppendWritesHistory") + private ProtectedAppendWritesHistory protectedAppendWritesHistory; + + /** + * Get the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the tags property: The list of LegalHold tags of a blob container. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The list of LegalHold tags of a blob container. + * + * @param tags the tags value to set. + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the protectedAppendWritesHistory property: Protected append blob writes history. + * + * @return the protectedAppendWritesHistory value. + */ + public ProtectedAppendWritesHistory protectedAppendWritesHistory() { + return this.protectedAppendWritesHistory; + } + + /** + * Set the protectedAppendWritesHistory property: Protected append blob writes history. + * + * @param protectedAppendWritesHistory the protectedAppendWritesHistory value to set. + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties withProtectedAppendWritesHistory( + ProtectedAppendWritesHistory protectedAppendWritesHistory) { + this.protectedAppendWritesHistory = protectedAppendWritesHistory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (protectedAppendWritesHistory() != null) { + protectedAppendWritesHistory().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java new file mode 100644 index 0000000000000..b3f2ecd4de033 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; + +/** An immutable client-side representation of ListAccountSasResponse. */ +public interface ListAccountSasResponse { + /** + * Gets the accountSasToken property: List SAS credentials of storage account. + * + * @return the accountSasToken value. + */ + String accountSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner object. + * + * @return the inner object. + */ + ListAccountSasResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java new file mode 100644 index 0000000000000..584ba7edf4aeb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of blob inventory policies returned. */ +@Immutable +public final class ListBlobInventoryPolicy { + /* + * List of blob inventory policies. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: List of blob inventory policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java new file mode 100644 index 0000000000000..b36b191c03512 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of ListContainerItem. */ +public interface ListContainerItem { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the version property: The version of the deleted blob container. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * Gets the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * Gets the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, + * only when the container is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * Gets the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * Gets the hasLegalHold property: 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. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the hasImmutabilityPolicy property: 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. + * + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * Gets the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageWithVersioning immutableStorageWithVersioning(); + + /** + * Gets the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + Boolean enableNfsV3RootSquash(); + + /** + * Gets the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + Boolean enableNfsV3AllSquash(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner object. + * + * @return the inner object. + */ + ListContainerItemInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java new file mode 100644 index 0000000000000..9d8f5b8dc575a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of + * containers. + */ +@Immutable +public final class ListContainerItems { + /* + * List of blobs containers returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of containers. Returned when total number of requested + * containers exceed maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of blobs containers returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of containers. Returned when total + * number of requested containers exceed maximum page size. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java new file mode 100644 index 0000000000000..40970e6f9b17a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ListContainersInclude. */ +public final class ListContainersInclude extends ExpandableStringEnum { + /** Static value deleted for ListContainersInclude. */ + public static final ListContainersInclude DELETED = fromString("deleted"); + + /** + * Creates or finds a ListContainersInclude from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListContainersInclude. + */ + @JsonCreator + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** + * Gets known ListContainersInclude values. + * + * @return known ListContainersInclude values. + */ + public static Collection values() { + return values(ListContainersInclude.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java new file mode 100644 index 0000000000000..45c7d8ac5b758 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ListKeyExpand. */ +public enum ListKeyExpand { + /** Enum value kerb. */ + KERB("kerb"); + + /** The actual serialized value for a ListKeyExpand instance. */ + private final String value; + + ListKeyExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ListKeyExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed ListKeyExpand object, or null if unable to parse. + */ + @JsonCreator + public static ListKeyExpand fromString(String value) { + if (value == null) { + return null; + } + ListKeyExpand[] items = ListKeyExpand.values(); + for (ListKeyExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java new file mode 100644 index 0000000000000..58e5c518257f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import java.util.Map; + +/** An immutable client-side representation of ListQueue. */ +public interface ListQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner object. + * + * @return the inner object. + */ + ListQueueInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java new file mode 100644 index 0000000000000..593499462e295 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response schema. Contains list of queues returned. */ +@Immutable +public final class ListQueueResource { + /* + * List of queues returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to list next page of queues + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of queues returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to list next page of queues. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java new file mode 100644 index 0000000000000..b005134f75146 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import java.util.List; + +/** An immutable client-side representation of ListQueueServices. */ +public interface ListQueueServices { + /** + * Gets the value property: List of queue services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner object. + * + * @return the inner object. + */ + ListQueueServicesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java new file mode 100644 index 0000000000000..51264cc8b2b58 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; + +/** An immutable client-side representation of ListServiceSasResponse. */ +public interface ListServiceSasResponse { + /** + * Gets the serviceSasToken property: List service SAS credentials of specific resource. + * + * @return the serviceSasToken value. + */ + String serviceSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner object. + * + * @return the inner object. + */ + ListServiceSasResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java new file mode 100644 index 0000000000000..1a6db6564ae5a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response schema. Contains list of tables returned. */ +@Immutable +public final class ListTableResource { + /* + * List of tables returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of tables + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of tables returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of tables. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java new file mode 100644 index 0000000000000..1b6289ba36b0f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import java.util.List; + +/** An immutable client-side representation of ListTableServices. */ +public interface ListTableServices { + /** + * Gets the value property: List of table services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner object. + * + * @return the inner object. + */ + ListTableServicesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java new file mode 100644 index 0000000000000..353ea09b1f511 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import java.util.List; + +/** An immutable client-side representation of LocalUser. */ +public interface LocalUser { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + List permissionScopes(); + + /** + * Gets the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + String homeDirectory(); + + /** + * Gets the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + List sshAuthorizedKeys(); + + /** + * Gets the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + String sid(); + + /** + * Gets the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + Boolean hasSharedKey(); + + /** + * Gets the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + Boolean hasSshKey(); + + /** + * Gets the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + Boolean hasSshPassword(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner object. + * + * @return the inner object. + */ + LocalUserInner innerModel(); + + /** The entirety of the LocalUser definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The LocalUser definition stages. */ + interface DefinitionStages { + /** The first stage of the LocalUser definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the LocalUser definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the LocalUser definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPermissionScopes, + DefinitionStages.WithHomeDirectory, + DefinitionStages.WithSshAuthorizedKeys, + DefinitionStages.WithHasSharedKey, + DefinitionStages.WithHasSshKey, + DefinitionStages.WithHasSshPassword { + /** + * Executes the create request. + * + * @return the created resource. + */ + LocalUser create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LocalUser create(Context context); + } + /** The stage of the LocalUser definition allowing to specify permissionScopes. */ + interface WithPermissionScopes { + /** + * Specifies the permissionScopes property: The permission scopes of the local user.. + * + * @param permissionScopes The permission scopes of the local user. + * @return the next definition stage. + */ + WithCreate withPermissionScopes(List permissionScopes); + } + /** The stage of the LocalUser definition allowing to specify homeDirectory. */ + interface WithHomeDirectory { + /** + * Specifies the homeDirectory property: Optional, local user home directory.. + * + * @param homeDirectory Optional, local user home directory. + * @return the next definition stage. + */ + WithCreate withHomeDirectory(String homeDirectory); + } + /** The stage of the LocalUser definition allowing to specify sshAuthorizedKeys. */ + interface WithSshAuthorizedKeys { + /** + * Specifies the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP.. + * + * @param sshAuthorizedKeys Optional, local user ssh authorized keys for SFTP. + * @return the next definition stage. + */ + WithCreate withSshAuthorizedKeys(List sshAuthorizedKeys); + } + /** The stage of the LocalUser definition allowing to specify hasSharedKey. */ + interface WithHasSharedKey { + /** + * Specifies the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove + * existing shared key.. + * + * @param hasSharedKey Indicates whether shared key exists. Set it to false to remove existing shared key. + * @return the next definition stage. + */ + WithCreate withHasSharedKey(Boolean hasSharedKey); + } + /** The stage of the LocalUser definition allowing to specify hasSshKey. */ + interface WithHasSshKey { + /** + * Specifies the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing + * SSH key.. + * + * @param hasSshKey Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * @return the next definition stage. + */ + WithCreate withHasSshKey(Boolean hasSshKey); + } + /** The stage of the LocalUser definition allowing to specify hasSshPassword. */ + interface WithHasSshPassword { + /** + * Specifies the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove + * existing SSH password.. + * + * @param hasSshPassword Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * @return the next definition stage. + */ + WithCreate withHasSshPassword(Boolean hasSshPassword); + } + } + /** + * Begins update for the LocalUser resource. + * + * @return the stage of resource update. + */ + LocalUser.Update update(); + + /** The template for LocalUser update. */ + interface Update + extends UpdateStages.WithPermissionScopes, + UpdateStages.WithHomeDirectory, + UpdateStages.WithSshAuthorizedKeys, + UpdateStages.WithHasSharedKey, + UpdateStages.WithHasSshKey, + UpdateStages.WithHasSshPassword { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LocalUser apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LocalUser apply(Context context); + } + /** The LocalUser update stages. */ + interface UpdateStages { + /** The stage of the LocalUser update allowing to specify permissionScopes. */ + interface WithPermissionScopes { + /** + * Specifies the permissionScopes property: The permission scopes of the local user.. + * + * @param permissionScopes The permission scopes of the local user. + * @return the next definition stage. + */ + Update withPermissionScopes(List permissionScopes); + } + /** The stage of the LocalUser update allowing to specify homeDirectory. */ + interface WithHomeDirectory { + /** + * Specifies the homeDirectory property: Optional, local user home directory.. + * + * @param homeDirectory Optional, local user home directory. + * @return the next definition stage. + */ + Update withHomeDirectory(String homeDirectory); + } + /** The stage of the LocalUser update allowing to specify sshAuthorizedKeys. */ + interface WithSshAuthorizedKeys { + /** + * Specifies the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP.. + * + * @param sshAuthorizedKeys Optional, local user ssh authorized keys for SFTP. + * @return the next definition stage. + */ + Update withSshAuthorizedKeys(List sshAuthorizedKeys); + } + /** The stage of the LocalUser update allowing to specify hasSharedKey. */ + interface WithHasSharedKey { + /** + * Specifies the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove + * existing shared key.. + * + * @param hasSharedKey Indicates whether shared key exists. Set it to false to remove existing shared key. + * @return the next definition stage. + */ + Update withHasSharedKey(Boolean hasSharedKey); + } + /** The stage of the LocalUser update allowing to specify hasSshKey. */ + interface WithHasSshKey { + /** + * Specifies the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing + * SSH key.. + * + * @param hasSshKey Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * @return the next definition stage. + */ + Update withHasSshKey(Boolean hasSshKey); + } + /** The stage of the LocalUser update allowing to specify hasSshPassword. */ + interface WithHasSshPassword { + /** + * Specifies the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove + * existing SSH password.. + * + * @param hasSshPassword Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * @return the next definition stage. + */ + Update withHasSshPassword(Boolean hasSshPassword); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LocalUser refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LocalUser refresh(Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + LocalUserKeys listKeys(); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + Response listKeysWithResponse(Context context); + + /** + * Regenerate the local user SSH password. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + LocalUserRegeneratePasswordResult regeneratePassword(); + + /** + * Regenerate the local user SSH password. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + Response regeneratePasswordWithResponse(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java new file mode 100644 index 0000000000000..315e5131837c5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import java.util.List; + +/** An immutable client-side representation of LocalUserKeys. */ +public interface LocalUserKeys { + /** + * Gets the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + List sshAuthorizedKeys(); + + /** + * Gets the sharedKey property: Auto generated by the server for SMB authentication. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner object. + * + * @return the inner object. + */ + LocalUserKeysInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java new file mode 100644 index 0000000000000..975acb61d96b8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; + +/** An immutable client-side representation of LocalUserRegeneratePasswordResult. */ +public interface LocalUserRegeneratePasswordResult { + /** + * Gets the sshPassword property: Auto generated password by the server for SSH authentication if hasSshPassword is + * set to true on the creation of local user. + * + * @return the sshPassword value. + */ + String sshPassword(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner + * object. + * + * @return the inner object. + */ + LocalUserRegeneratePasswordResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java new file mode 100644 index 0000000000000..6add676dc94ab --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List storage account local users. */ +@Fluent +public final class LocalUsers { + /* + * The local users associated with the storage account. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The local users associated with the storage account. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The local users associated with the storage account. + * + * @param value the value value to set. + * @return the LocalUsers object itself. + */ + public LocalUsers withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java new file mode 100644 index 0000000000000..b8c3a3162d8ad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LocalUsersOperations. */ +public interface LocalUsersOperations { + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account local users as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + LocalUser get(String resourceGroupName, String accountName, String username); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String username); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + LocalUserKeys listKeys(String resourceGroupName, String accountName, String username); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + Response listKeysWithResponse( + String resourceGroupName, String accountName, String username, Context context); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + LocalUserRegeneratePasswordResult regeneratePassword(String resourceGroupName, String accountName, String username); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + Response regeneratePasswordWithResponse( + String resourceGroupName, String accountName, String username, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + LocalUser getById(String id); + + /** + * Get the local user of the storage account by username. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LocalUser resource. + * + * @param name resource name. + * @return the first stage of the new LocalUser definition. + */ + LocalUser.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java new file mode 100644 index 0000000000000..65a6bedc87301 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagementPolicies. */ +public interface ManagementPolicies { + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account. + */ + ManagementPolicy get(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + ManagementPolicy getById(String id); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagementPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ManagementPolicy definition. + */ + ManagementPolicy.DefinitionStages.Blank define(ManagementPolicyName name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java new file mode 100644 index 0000000000000..7d0be0aa09123 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ManagementPolicy. */ +public interface ManagementPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + ManagementPolicySchema policy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner object. + * + * @return the inner object. + */ + ManagementPolicyInner innerModel(); + + /** The entirety of the ManagementPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ManagementPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagementPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ManagementPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the ManagementPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagementPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagementPolicy create(Context context); + } + /** The stage of the ManagementPolicy definition allowing to specify policy. */ + interface WithPolicy { + /** + * Specifies the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withPolicy(ManagementPolicySchema policy); + } + } + /** + * Begins update for the ManagementPolicy resource. + * + * @return the stage of resource update. + */ + ManagementPolicy.Update update(); + + /** The template for ManagementPolicy update. */ + interface Update extends UpdateStages.WithPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagementPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagementPolicy apply(Context context); + } + /** The ManagementPolicy update stages. */ + interface UpdateStages { + /** The stage of the ManagementPolicy update allowing to specify policy. */ + interface WithPolicy { + /** + * Specifies the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.. + * + * @param 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. + * @return the next definition stage. + */ + Update withPolicy(ManagementPolicySchema policy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagementPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagementPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java new file mode 100644 index 0000000000000..7da6315bf937c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Actions are applied to the filtered blobs when the execution condition is met. */ +@Fluent +public final class ManagementPolicyAction { + /* + * The management policy action for base blob + */ + @JsonProperty(value = "baseBlob") + private ManagementPolicyBaseBlob baseBlob; + + /* + * The management policy action for snapshot + */ + @JsonProperty(value = "snapshot") + private ManagementPolicySnapShot snapshot; + + /* + * The management policy action for version + */ + @JsonProperty(value = "version") + private ManagementPolicyVersion version; + + /** + * Get the baseBlob property: The management policy action for base blob. + * + * @return the baseBlob value. + */ + public ManagementPolicyBaseBlob baseBlob() { + return this.baseBlob; + } + + /** + * Set the baseBlob property: The management policy action for base blob. + * + * @param baseBlob the baseBlob value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withBaseBlob(ManagementPolicyBaseBlob baseBlob) { + this.baseBlob = baseBlob; + return this; + } + + /** + * Get the snapshot property: The management policy action for snapshot. + * + * @return the snapshot value. + */ + public ManagementPolicySnapShot snapshot() { + return this.snapshot; + } + + /** + * Set the snapshot property: The management policy action for snapshot. + * + * @param snapshot the snapshot value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withSnapshot(ManagementPolicySnapShot snapshot) { + this.snapshot = snapshot; + return this; + } + + /** + * Get the version property: The management policy action for version. + * + * @return the version value. + */ + public ManagementPolicyVersion version() { + return this.version; + } + + /** + * Set the version property: The management policy action for version. + * + * @param version the version value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withVersion(ManagementPolicyVersion version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseBlob() != null) { + baseBlob().validate(); + } + if (snapshot() != null) { + snapshot().validate(); + } + if (version() != null) { + version().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java new file mode 100644 index 0000000000000..7004355fc08fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for base blob. */ +@Fluent +public final class ManagementPolicyBaseBlob { + /* + * The function to tier blobs to cool storage. Support blobs currently at Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterModification tierToCool; + + /* + * The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterModification tierToArchive; + + /* + * The function to delete the blob + */ + @JsonProperty(value = "delete") + private DateAfterModification delete; + + /* + * This property enables auto tiering of a blob from cool to hot on a blob access. This property requires + * tierToCool.daysAfterLastAccessTimeGreaterThan. + */ + @JsonProperty(value = "enableAutoTierToHotFromCool") + private Boolean enableAutoTierToHotFromCool; + + /** + * Get the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterModification tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToCool(DateAfterModification tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blobs to archive storage. Support blobs currently at Hot or + * Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterModification tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blobs to archive storage. Support blobs currently at Hot or + * Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the delete property: The function to delete the blob. + * + * @return the delete value. + */ + public DateAfterModification delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob. + * + * @param delete the delete value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withDelete(DateAfterModification delete) { + this.delete = delete; + return this; + } + + /** + * Get the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a + * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + * + * @return the enableAutoTierToHotFromCool value. + */ + public Boolean enableAutoTierToHotFromCool() { + return this.enableAutoTierToHotFromCool; + } + + /** + * Set the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a + * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + * + * @param enableAutoTierToHotFromCool the enableAutoTierToHotFromCool value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withEnableAutoTierToHotFromCool(Boolean enableAutoTierToHotFromCool) { + this.enableAutoTierToHotFromCool = enableAutoTierToHotFromCool; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (delete() != null) { + delete().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java new file mode 100644 index 0000000000000..382cfa65330fc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. */ +@Fluent +public final class ManagementPolicyDefinition { + /* + * An object that defines the action set. + */ + @JsonProperty(value = "actions", required = true) + private ManagementPolicyAction actions; + + /* + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ManagementPolicyFilter filters; + + /** + * Get the actions property: An object that defines the action set. + * + * @return the actions value. + */ + public ManagementPolicyAction actions() { + return this.actions; + } + + /** + * Set the actions property: An object that defines the action set. + * + * @param actions the actions value to set. + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withActions(ManagementPolicyAction actions) { + this.actions = actions; + return this; + } + + /** + * Get the filters property: An object that defines the filter set. + * + * @return the filters value. + */ + public ManagementPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withFilters(ManagementPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actions in model ManagementPolicyDefinition")); + } else { + actions().validate(); + } + if (filters() != null) { + filters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyDefinition.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java new file mode 100644 index 0000000000000..a691baf46e804 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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. + */ +@Fluent +public final class ManagementPolicyFilter { + /* + * An array of strings for prefixes to be match. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /* + * An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete + * actions are supported for appendBlob. + */ + @JsonProperty(value = "blobTypes", required = true) + private List blobTypes; + + /* + * An array of blob index tag based filters, there can be at most 10 tag filters + */ + @JsonProperty(value = "blobIndexMatch") + private List blobIndexMatch; + + /** + * Get the prefixMatch property: An array of strings for prefixes to be match. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: An array of strings for prefixes to be match. + * + * @param prefixMatch the prefixMatch value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and + * delete actions. Only delete actions are supported for appendBlob. + * + * @return the blobTypes value. + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and + * delete actions. Only delete actions are supported for appendBlob. + * + * @param blobTypes the blobTypes value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + + /** + * Get the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. + * + * @return the blobIndexMatch value. + */ + public List blobIndexMatch() { + return this.blobIndexMatch; + } + + /** + * Set the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. + * + * @param blobIndexMatch the blobIndexMatch value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobIndexMatch(List blobIndexMatch) { + this.blobIndexMatch = blobIndexMatch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobTypes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobTypes in model ManagementPolicyFilter")); + } + if (blobIndexMatch() != null) { + blobIndexMatch().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyFilter.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java new file mode 100644 index 0000000000000..d5735fd0888b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagementPolicyName. */ +public final class ManagementPolicyName extends ExpandableStringEnum { + /** Static value default for ManagementPolicyName. */ + public static final ManagementPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a ManagementPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementPolicyName. + */ + @JsonCreator + public static ManagementPolicyName fromString(String name) { + return fromString(name, ManagementPolicyName.class); + } + + /** + * Gets known ManagementPolicyName values. + * + * @return known ManagementPolicyName values. + */ + public static Collection values() { + return values(ManagementPolicyName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java new file mode 100644 index 0000000000000..6a659f117e179 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. */ +@Fluent +public final class ManagementPolicyRule { + /* + * Rule is enabled if set to true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be + * unique within a policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The valid value is Lifecycle + */ + @JsonProperty(value = "type", required = true) + private RuleType type; + + /* + * An object that defines the Lifecycle rule. + */ + @JsonProperty(value = "definition", required = true) + private ManagementPolicyDefinition definition; + + /** + * Get the enabled property: Rule is enabled if set to true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Rule is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @param name the name value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The valid value is Lifecycle. + * + * @return the type value. + */ + public RuleType type() { + return this.type; + } + + /** + * Set the type property: The valid value is Lifecycle. + * + * @param type the type value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withType(RuleType type) { + this.type = type; + return this; + } + + /** + * Get the definition property: An object that defines the Lifecycle rule. + * + * @return the definition value. + */ + public ManagementPolicyDefinition definition() { + return this.definition; + } + + /** + * Set the definition property: An object that defines the Lifecycle rule. + * + * @param definition the definition value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withDefinition(ManagementPolicyDefinition definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ManagementPolicyRule")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagementPolicyRule")); + } + if (definition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property definition in model ManagementPolicyRule")); + } else { + definition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java new file mode 100644 index 0000000000000..125e8ed05f600 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +@Fluent +public final class ManagementPolicySchema { + /* + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * Get the rules property: The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param rules the rules value to set. + * @return the ManagementPolicySchema object itself. + */ + public ManagementPolicySchema withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rules in model ManagementPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicySchema.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java new file mode 100644 index 0000000000000..a87ad954d5b80 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for snapshot. */ +@Fluent +public final class ManagementPolicySnapShot { + /* + * The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterCreation tierToCool; + + /* + * The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterCreation tierToArchive; + + /* + * The function to delete the blob snapshot + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently + * at Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently + * at Hot tier. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToCool(DateAfterCreation tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blob snapshot to archive storage. Support blob snapshot + * currently at Hot or Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob snapshot to archive storage. Support blob snapshot + * currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the delete property: The function to delete the blob snapshot. + * + * @return the delete value. + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob snapshot. + * + * @param delete the delete value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (delete() != null) { + delete().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java new file mode 100644 index 0000000000000..47687f8a301e7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for blob version. */ +@Fluent +public final class ManagementPolicyVersion { + /* + * The function to tier blob version to cool storage. Support blob version currently at Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterCreation tierToCool; + + /* + * The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterCreation tierToArchive; + + /* + * The function to delete the blob version + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at + * Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at + * Hot tier. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToCool(DateAfterCreation tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blob version to archive storage. Support blob version + * currently at Hot or Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob version to archive storage. Support blob version + * currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the delete property: The function to delete the blob version. + * + * @return the delete value. + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob version. + * + * @param delete the delete value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (delete() != null) { + delete().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..a5ce1a79f6d3e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + /* + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of metric specification. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of metric specification. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description of metric specification. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit could be Bytes or Count. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit could be Bytes or Count. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the dimensions property: Dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the aggregationType property: Aggregation type could be Average. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the fillGapWithZero property: The property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: The property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category property: The category this metric specification belong to, could be Capacity. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category this metric specification belong to, could be Capacity. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the resourceIdDimensionNameOverride property: Account Resource Id. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: Account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java new file mode 100644 index 0000000000000..b75495d44ee80 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationState. */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value InProgress for MigrationState. */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for MigrationState. */ + public static final MigrationState COMPLETED = fromString("Completed"); + + /** + * Creates or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * Gets known MigrationState values. + * + * @return known MigrationState values. + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java new file mode 100644 index 0000000000000..11c13b63d3f80 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MinimumTlsVersion. */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** Static value TLS1_0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** Static value TLS1_1 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** Static value TLS1_2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding MinimumTlsVersion. + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** + * Gets known MinimumTlsVersion values. + * + * @return known MinimumTlsVersion values. + */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java new file mode 100644 index 0000000000000..91ce5cb32221c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Multichannel setting. Applies to Premium FileStorage only. */ +@Fluent +public final class Multichannel { + /* + * Indicates whether multichannel is enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the enabled property: Indicates whether multichannel is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether multichannel is enabled. + * + * @param enabled the enabled value to set. + * @return the Multichannel object itself. + */ + public Multichannel withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java new file mode 100644 index 0000000000000..ac867c03e6a8e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Name. */ +public final class Name extends ExpandableStringEnum { + /** Static value AccessTimeTracking for Name. */ + public static final Name ACCESS_TIME_TRACKING = fromString("AccessTimeTracking"); + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + @JsonCreator + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** + * Gets known Name values. + * + * @return known Name values. + */ + public static Collection values() { + return values(Name.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..5980873317a9d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network rule set. */ +@Fluent +public final class 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. + */ + @JsonProperty(value = "bypass") + private Bypass bypass; + + /* + * Sets the resource access rules + */ + @JsonProperty(value = "resourceAccessRules") + private List resourceAccessRules; + + /* + * Sets the virtual network rules + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * Sets the IP ACL rules + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /* + * Specifies the default action of allow or deny when no other rules match. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * Get the bypass property: 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. + * + * @return the bypass value. + */ + public Bypass bypass() { + return this.bypass; + } + + /** + * Set the bypass property: 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. + * + * @param bypass the bypass value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(Bypass bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the resourceAccessRules property: Sets the resource access rules. + * + * @return the resourceAccessRules value. + */ + public List resourceAccessRules() { + return this.resourceAccessRules; + } + + /** + * Set the resourceAccessRules property: Sets the resource access rules. + * + * @param resourceAccessRules the resourceAccessRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withResourceAccessRules(List resourceAccessRules) { + this.resourceAccessRules = resourceAccessRules; + return this; + } + + /** + * Get the virtualNetworkRules property: Sets the virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: Sets the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the ipRules property: Sets the IP ACL rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: Sets the IP ACL rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the defaultAction property: Specifies the default action of allow or deny when no other rules match. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Specifies the default action of allow or deny when no other rules match. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceAccessRules() != null) { + resourceAccessRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + if (defaultAction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java new file mode 100644 index 0000000000000..b3c4c5ed2f2a4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List storage account object replication policies. */ +@Fluent +public final class ObjectReplicationPolicies { + /* + * The replication policy between two storage accounts. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The replication policy between two storage accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The replication policy between two storage accounts. + * + * @param value the value value to set. + * @return the ObjectReplicationPolicies object itself. + */ + public ObjectReplicationPolicies withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java new file mode 100644 index 0000000000000..3386da834ae8c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ObjectReplicationPoliciesOperations. */ +public interface ObjectReplicationPoliciesOperations { + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID. + */ + ObjectReplicationPolicy get(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + ObjectReplicationPolicy getById(String id); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ObjectReplicationPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ObjectReplicationPolicy definition. + */ + ObjectReplicationPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java new file mode 100644 index 0000000000000..f94eea6cebd3a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ObjectReplicationPolicy. */ +public interface ObjectReplicationPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + String policyId(); + + /** + * Gets the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + OffsetDateTime enabledTime(); + + /** + * Gets the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + String sourceAccount(); + + /** + * Gets the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + String destinationAccount(); + + /** + * Gets the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner object. + * + * @return the inner object. + */ + ObjectReplicationPolicyInner innerModel(); + + /** The entirety of the ObjectReplicationPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ObjectReplicationPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ObjectReplicationPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ObjectReplicationPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the ObjectReplicationPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithSourceAccount, + DefinitionStages.WithDestinationAccount, + DefinitionStages.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + ObjectReplicationPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ObjectReplicationPolicy create(Context context); + } + /** The stage of the ObjectReplicationPolicy definition allowing to specify sourceAccount. */ + interface WithSourceAccount { + /** + * Specifies the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false.. + * + * @param sourceAccount Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + WithCreate withSourceAccount(String sourceAccount); + } + /** The stage of the ObjectReplicationPolicy definition allowing to specify destinationAccount. */ + interface WithDestinationAccount { + /** + * Specifies the destinationAccount property: Required. Destination account name. It should be full resource + * id if allowCrossTenantReplication set to false.. + * + * @param destinationAccount Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + WithCreate withDestinationAccount(String destinationAccount); + } + /** The stage of the ObjectReplicationPolicy definition allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: The storage account object replication rules.. + * + * @param rules The storage account object replication rules. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + /** + * Begins update for the ObjectReplicationPolicy resource. + * + * @return the stage of resource update. + */ + ObjectReplicationPolicy.Update update(); + + /** The template for ObjectReplicationPolicy update. */ + interface Update + extends UpdateStages.WithSourceAccount, UpdateStages.WithDestinationAccount, UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ObjectReplicationPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ObjectReplicationPolicy apply(Context context); + } + /** The ObjectReplicationPolicy update stages. */ + interface UpdateStages { + /** The stage of the ObjectReplicationPolicy update allowing to specify sourceAccount. */ + interface WithSourceAccount { + /** + * Specifies the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false.. + * + * @param sourceAccount Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + Update withSourceAccount(String sourceAccount); + } + /** The stage of the ObjectReplicationPolicy update allowing to specify destinationAccount. */ + interface WithDestinationAccount { + /** + * Specifies the destinationAccount property: Required. Destination account name. It should be full resource + * id if allowCrossTenantReplication set to false.. + * + * @param destinationAccount Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + Update withDestinationAccount(String destinationAccount); + } + /** The stage of the ObjectReplicationPolicy update allowing to specify rules. */ + interface WithRules { + /** + * Specifies the rules property: The storage account object replication rules.. + * + * @param rules The storage account object replication rules. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ObjectReplicationPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ObjectReplicationPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java new file mode 100644 index 0000000000000..b72d8fc36d2d5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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. + */ +@Fluent +public final class ObjectReplicationPolicyFilter { + /* + * Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /* + * 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 + */ + @JsonProperty(value = "minCreationTime") + private String minCreationTime; + + /** + * Get the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the + * specified prefix. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the + * specified prefix. + * + * @param prefixMatch the prefixMatch value to set. + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the minCreationTime property: 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. + * + * @return the minCreationTime value. + */ + public String minCreationTime() { + return this.minCreationTime; + } + + /** + * Set the minCreationTime property: 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. + * + * @param minCreationTime the minCreationTime value to set. + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withMinCreationTime(String minCreationTime) { + this.minCreationTime = minCreationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java new file mode 100644 index 0000000000000..b1c018703728a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The replication policy rule between two containers. */ +@Fluent +public final class ObjectReplicationPolicyRule { + /* + * Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source + * account. + */ + @JsonProperty(value = "ruleId") + private String ruleId; + + /* + * Required. Source container name. + */ + @JsonProperty(value = "sourceContainer", required = true) + private String sourceContainer; + + /* + * Required. Destination container name. + */ + @JsonProperty(value = "destinationContainer", required = true) + private String destinationContainer; + + /* + * Optional. An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ObjectReplicationPolicyFilter filters; + + /** + * Get the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for + * put policy on source account. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for + * put policy on source account. + * + * @param ruleId the ruleId value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the sourceContainer property: Required. Source container name. + * + * @return the sourceContainer value. + */ + public String sourceContainer() { + return this.sourceContainer; + } + + /** + * Set the sourceContainer property: Required. Source container name. + * + * @param sourceContainer the sourceContainer value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withSourceContainer(String sourceContainer) { + this.sourceContainer = sourceContainer; + return this; + } + + /** + * Get the destinationContainer property: Required. Destination container name. + * + * @return the destinationContainer value. + */ + public String destinationContainer() { + return this.destinationContainer; + } + + /** + * Set the destinationContainer property: Required. Destination container name. + * + * @param destinationContainer the destinationContainer value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withDestinationContainer(String destinationContainer) { + this.destinationContainer = destinationContainer; + return this; + } + + /** + * Get the filters property: Optional. An object that defines the filter set. + * + * @return the filters value. + */ + public ObjectReplicationPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: Optional. An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withFilters(ObjectReplicationPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceContainer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceContainer in model ObjectReplicationPolicyRule")); + } + if (destinationContainer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationContainer in model ObjectReplicationPolicyRule")); + } + if (filters() != null) { + filters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java new file mode 100644 index 0000000000000..562e86a9c9f3c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ObjectType. */ +public final class ObjectType extends ExpandableStringEnum { + /** Static value Blob for ObjectType. */ + public static final ObjectType BLOB = fromString("Blob"); + + /** Static value Container for ObjectType. */ + public static final ObjectType CONTAINER = fromString("Container"); + + /** + * Creates or finds a ObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObjectType. + */ + @JsonCreator + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** + * Gets known ObjectType values. + * + * @return known ObjectType values. + */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java new file mode 100644 index 0000000000000..92e73c11e7d00 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..ca372240cfd4c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Service provider: Microsoft Storage. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Service provider: Microsoft Storage. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft Storage. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Type of operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Type of operation: get, read, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..43260aa8b0883 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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. + */ +@Fluent +public final class OperationListResult { + /* + * List of Storage operations supported by the Storage resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: List of Storage operations supported by the Storage resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Storage operations supported by the Storage resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java new file mode 100644 index 0000000000000..e19ba027c3da8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java new file mode 100644 index 0000000000000..73b9a2e16d30c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PermissionScope model. */ +@Fluent +public final class PermissionScope { + /* + * The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and + * Create (c). + */ + @JsonProperty(value = "permissions", required = true) + private String permissions; + + /* + * The service used by the local user, e.g. blob, file. + */ + @JsonProperty(value = "service", required = true) + private String service; + + /* + * The name of resource, normally the container name or the file share name, used by the local user. + */ + @JsonProperty(value = "resourceName", required = true) + private String resourceName; + + /** + * Get the permissions property: The permissions for the local user. Possible values include: Read (r), Write (w), + * Delete (d), List (l), and Create (c). + * + * @return the permissions value. + */ + public String permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The permissions for the local user. Possible values include: Read (r), Write (w), + * Delete (d), List (l), and Create (c). + * + * @param permissions the permissions value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withPermissions(String permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the service property: The service used by the local user, e.g. blob, file. + * + * @return the service value. + */ + public String service() { + return this.service; + } + + /** + * Set the service property: The service used by the local user, e.g. blob, file. + * + * @param service the service value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withService(String service) { + this.service = service; + return this; + } + + /** + * Get the resourceName property: The name of resource, normally the container name or the file share name, used by + * the local user. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of resource, normally the container name or the file share name, used by + * the local user. + * + * @param resourceName the resourceName value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property permissions in model PermissionScope")); + } + if (service() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property service in model PermissionScope")); + } + if (resourceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceName in model PermissionScope")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PermissionScope.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java new file mode 100644 index 0000000000000..d73fe24f97319 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Permissions. */ +public final class Permissions extends ExpandableStringEnum { + /** Static value r for Permissions. */ + public static final Permissions R = fromString("r"); + + /** Static value d for Permissions. */ + public static final Permissions D = fromString("d"); + + /** Static value w for Permissions. */ + public static final Permissions W = fromString("w"); + + /** Static value l for Permissions. */ + public static final Permissions L = fromString("l"); + + /** Static value a for Permissions. */ + public static final Permissions A = fromString("a"); + + /** Static value c for Permissions. */ + public static final Permissions C = fromString("c"); + + /** Static value u for Permissions. */ + public static final Permissions U = fromString("u"); + + /** Static value p for Permissions. */ + public static final Permissions P = fromString("p"); + + /** + * Creates or finds a Permissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding Permissions. + */ + @JsonCreator + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** + * Gets known Permissions values. + * + * @return known Permissions values. + */ + public static Collection values() { + return values(Permissions.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..870baef5b3ff9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..cd70afc183ff1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..38a840298442e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connection associated with the specified storage account. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..8cce4aa3f830b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..640b74175d727 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account. + */ + PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link + * Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with {@link + * Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..fa7f131270e9a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..6df6fccdcfce1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResource extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..5a97ee184f390 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..6fc2c67e5df11 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account. + */ + PrivateLinkResourceListResult listByStorageAccount(String resourceGroupName, String accountName); + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a storage account along with {@link Response}. + */ + Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..d5ff7a52e4e05 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionRequired value. + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set the actionRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionRequired the actionRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java new file mode 100644 index 0000000000000..2484ffb4a1f7f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Protected append writes history setting for the blob container with Legal holds. */ +@Fluent +public final class ProtectedAppendWritesHistory { + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWritesAll") + private Boolean allowProtectedAppendWritesAll; + + /* + * Returns the date and time the tag was added. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ProtectedAppendWritesHistory object itself. + */ + public ProtectedAppendWritesHistory withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Get the timestamp property: Returns the date and time the tag was added. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java new file mode 100644 index 0000000000000..7d33d1a441bcc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protocol settings for file service. */ +@Fluent +public final class ProtocolSettings { + /* + * Setting for SMB protocol + */ + @JsonProperty(value = "smb") + private SmbSetting smb; + + /** + * Get the smb property: Setting for SMB protocol. + * + * @return the smb value. + */ + public SmbSetting smb() { + return this.smb; + } + + /** + * Set the smb property: Setting for SMB protocol. + * + * @param smb the smb value to set. + * @return the ProtocolSettings object itself. + */ + public ProtocolSettings withSmb(SmbSetting smb) { + this.smb = smb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (smb() != null) { + smb().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..0af75aa221138 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProvisioningState. */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value ResolvingDNS. */ + RESOLVING_DNS("ResolvingDNS"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProvisioningState instance. */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + if (value == null) { + return null; + } + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java new file mode 100644 index 0000000000000..73616dc162b19 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for PublicAccess. */ +public enum PublicAccess { + /** Enum value Container. */ + CONTAINER("Container"), + + /** Enum value Blob. */ + BLOB("Blob"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a PublicAccess instance. */ + private final String value; + + PublicAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicAccess object, or null if unable to parse. + */ + @JsonCreator + public static PublicAccess fromString(String value) { + if (value == null) { + return null; + } + PublicAccess[] items = PublicAccess.values(); + for (PublicAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..e98e4362d5ab5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java new file mode 100644 index 0000000000000..d3fe3822f635e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; + +/** An immutable client-side representation of QueueServiceProperties. */ +public interface QueueServiceProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the cors property: 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. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner object. + * + * @return the inner object. + */ + QueueServicePropertiesInner innerModel(); + + /** The entirety of the QueueServiceProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The QueueServiceProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the QueueServiceProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the QueueServiceProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the QueueServiceProperties definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithCors { + /** + * Executes the create request. + * + * @return the created resource. + */ + QueueServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + QueueServiceProperties create(Context context); + } + /** The stage of the QueueServiceProperties definition allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + } + /** + * Begins update for the QueueServiceProperties resource. + * + * @return the stage of resource update. + */ + QueueServiceProperties.Update update(); + + /** The template for QueueServiceProperties update. */ + interface Update extends UpdateStages.WithCors { + /** + * Executes the update request. + * + * @return the updated resource. + */ + QueueServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + QueueServiceProperties apply(Context context); + } + /** The QueueServiceProperties update stages. */ + interface UpdateStages { + /** The stage of the QueueServiceProperties update allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + QueueServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + QueueServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java new file mode 100644 index 0000000000000..27c5e4de3e07d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of QueueServices. */ +public interface QueueServices { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ListQueueServices list(String resourceGroupName, String accountName); + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + QueueServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + QueueServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new QueueServiceProperties resource. + * + * @return the first stage of the new QueueServiceProperties definition. + */ + QueueServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java new file mode 100644 index 0000000000000..31677d34930b8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Queues. */ +public interface Queues { + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists. + */ + StorageQueue get(String resourceGroupName, String accountName, String queueName); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the queues under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String accountName, String maxpagesize, String filter, Context context); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response}. + */ + StorageQueue getById(String id); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with {@link + * Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageQueue resource. + * + * @param name resource name. + * @return the first stage of the new StorageQueue definition. + */ + StorageQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java new file mode 100644 index 0000000000000..b499b4324053f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Reason. */ +public enum Reason { + /** Enum value AccountNameInvalid. */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a Reason instance. */ + private final String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + @JsonCreator + public static Reason fromString(String value) { + if (value == null) { + return null; + } + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java new file mode 100644 index 0000000000000..af9dcde3422a1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReasonCode. */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReasonCode. + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * Gets known ReasonCode values. + * + * @return known ReasonCode values. + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java new file mode 100644 index 0000000000000..3bcc262768c4a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Access Rule. */ +@Fluent +public final class ResourceAccessRule { + /* + * Tenant Id + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Resource Id + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Get the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id. + * + * @param resourceId the resourceId value to set. + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java new file mode 100644 index 0000000000000..5609d6822bed5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The blob service properties for blob restore policy. */ +@Fluent +public final class RestorePolicyProperties { + /* + * Blob restore is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * Deprecated in favor of minRestoreTime property. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastEnabledTime; + + /* + * Returns the minimum date and time that the restore can be started. + */ + @JsonProperty(value = "minRestoreTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime minRestoreTime; + + /** + * Get the enabled property: Blob restore is enabled if set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Blob restore is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the days property: how long this blob can be restored. It should be great than zero and less than + * DeleteRetentionPolicy.days. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: how long this blob can be restored. It should be great than zero and less than + * DeleteRetentionPolicy.days. + * + * @param days the days value to set. + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the lastEnabledTime property: Deprecated in favor of minRestoreTime property. + * + * @return the lastEnabledTime value. + */ + public OffsetDateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get the minRestoreTime property: Returns the minimum date and time that the restore can be started. + * + * @return the minRestoreTime value. + */ + public OffsetDateTime minRestoreTime() { + return this.minRestoreTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java new file mode 100644 index 0000000000000..7863ae8ce1543 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The restriction because of which SKU cannot be used. */ +@Fluent +public final class Restriction { + /* + * The type of restrictions. As of now only possible value for this is location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The value of restrictions. If the restriction type is set to location. This would be different locations where + * the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * 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. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * Get the type property: The type of restrictions. As of now only possible value for this is location. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the reasonCode property: 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. + * + * @return the reasonCode value. + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: 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. + * + * @param reasonCode the reasonCode value to set. + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java new file mode 100644 index 0000000000000..21837edff3ef5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RootSquashType. */ +public final class RootSquashType extends ExpandableStringEnum { + /** Static value NoRootSquash for RootSquashType. */ + public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** Static value RootSquash for RootSquashType. */ + public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); + + /** Static value AllSquash for RootSquashType. */ + public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates or finds a RootSquashType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RootSquashType. + */ + @JsonCreator + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** + * Gets known RootSquashType values. + * + * @return known RootSquashType values. + */ + public static Collection values() { + return values(RootSquashType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java new file mode 100644 index 0000000000000..ebcfe0900d550 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingChoice. */ +public final class RoutingChoice extends ExpandableStringEnum { + /** Static value MicrosoftRouting for RoutingChoice. */ + public static final RoutingChoice MICROSOFT_ROUTING = fromString("MicrosoftRouting"); + + /** Static value InternetRouting for RoutingChoice. */ + public static final RoutingChoice INTERNET_ROUTING = fromString("InternetRouting"); + + /** + * Creates or finds a RoutingChoice from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingChoice. + */ + @JsonCreator + public static RoutingChoice fromString(String name) { + return fromString(name, RoutingChoice.class); + } + + /** + * Gets known RoutingChoice values. + * + * @return known RoutingChoice values. + */ + public static Collection values() { + return values(RoutingChoice.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java new file mode 100644 index 0000000000000..fe840b0bf22ee --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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. + */ +@Fluent +public final class RoutingPreference { + /* + * Routing Choice defines the kind of network routing opted by the user. + */ + @JsonProperty(value = "routingChoice") + private RoutingChoice routingChoice; + + /* + * A boolean flag which indicates whether microsoft routing storage endpoints are to be published + */ + @JsonProperty(value = "publishMicrosoftEndpoints") + private Boolean publishMicrosoftEndpoints; + + /* + * A boolean flag which indicates whether internet routing storage endpoints are to be published + */ + @JsonProperty(value = "publishInternetEndpoints") + private Boolean publishInternetEndpoints; + + /** + * Get the routingChoice property: Routing Choice defines the kind of network routing opted by the user. + * + * @return the routingChoice value. + */ + public RoutingChoice routingChoice() { + return this.routingChoice; + } + + /** + * Set the routingChoice property: Routing Choice defines the kind of network routing opted by the user. + * + * @param routingChoice the routingChoice value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withRoutingChoice(RoutingChoice routingChoice) { + this.routingChoice = routingChoice; + return this; + } + + /** + * Get the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published. + * + * @return the publishMicrosoftEndpoints value. + */ + public Boolean publishMicrosoftEndpoints() { + return this.publishMicrosoftEndpoints; + } + + /** + * Set the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published. + * + * @param publishMicrosoftEndpoints the publishMicrosoftEndpoints value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishMicrosoftEndpoints(Boolean publishMicrosoftEndpoints) { + this.publishMicrosoftEndpoints = publishMicrosoftEndpoints; + return this; + } + + /** + * Get the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage + * endpoints are to be published. + * + * @return the publishInternetEndpoints value. + */ + public Boolean publishInternetEndpoints() { + return this.publishInternetEndpoints; + } + + /** + * Set the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage + * endpoints are to be published. + * + * @param publishInternetEndpoints the publishInternetEndpoints value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishInternetEndpoints(Boolean publishInternetEndpoints) { + this.publishInternetEndpoints = publishInternetEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java new file mode 100644 index 0000000000000..2ce92c2ccf094 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuleType. */ +public final class RuleType extends ExpandableStringEnum { + /** Static value Lifecycle for RuleType. */ + public static final RuleType LIFECYCLE = fromString("Lifecycle"); + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + @JsonCreator + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** + * Gets known RuleType values. + * + * @return known RuleType values. + */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java new file mode 100644 index 0000000000000..e3cd36a2066da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SasPolicy assigned to the storage account. */ +@Fluent +public final class SasPolicy { + /* + * The SAS expiration period, DD.HH:MM:SS. + */ + @JsonProperty(value = "sasExpirationPeriod", required = true) + private String sasExpirationPeriod; + + /* + * The SAS expiration action. Can only be Log. + */ + @JsonProperty(value = "expirationAction", required = true) + private ExpirationAction expirationAction; + + /** + * Get the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS. + * + * @return the sasExpirationPeriod value. + */ + public String sasExpirationPeriod() { + return this.sasExpirationPeriod; + } + + /** + * Set the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS. + * + * @param sasExpirationPeriod the sasExpirationPeriod value to set. + * @return the SasPolicy object itself. + */ + public SasPolicy withSasExpirationPeriod(String sasExpirationPeriod) { + this.sasExpirationPeriod = sasExpirationPeriod; + return this; + } + + /** + * Get the expirationAction property: The SAS expiration action. Can only be Log. + * + * @return the expirationAction value. + */ + public ExpirationAction expirationAction() { + return this.expirationAction; + } + + /** + * Set the expirationAction property: The SAS expiration action. Can only be Log. + * + * @param expirationAction the expirationAction value to set. + * @return the SasPolicy object itself. + */ + public SasPolicy withExpirationAction(ExpirationAction expirationAction) { + this.expirationAction = expirationAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasExpirationPeriod() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sasExpirationPeriod in model SasPolicy")); + } + if (expirationAction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property expirationAction in model SasPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SasPolicy.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java new file mode 100644 index 0000000000000..6707ea3ee2950 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Schedule. */ +public final class Schedule extends ExpandableStringEnum { + /** Static value Daily for Schedule. */ + public static final Schedule DAILY = fromString("Daily"); + + /** Static value Weekly for Schedule. */ + public static final Schedule WEEKLY = fromString("Weekly"); + + /** + * Creates or finds a Schedule from its string representation. + * + * @param name a name to look for. + * @return the corresponding Schedule. + */ + @JsonCreator + public static Schedule fromString(String name) { + return fromString(name, Schedule.class); + } + + /** + * Gets known Schedule values. + * + * @return known Schedule values. + */ + public static Collection values() { + return values(Schedule.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java new file mode 100644 index 0000000000000..aa495c71eee69 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters to list service SAS credentials of a specific resource. */ +@Fluent +public final class ServiceSasParameters { + /* + * The canonical path to the signed resource. + */ + @JsonProperty(value = "canonicalizedResource", required = true) + private String canonicalizedResource; + + /* + * The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), + * Share (s). + */ + @JsonProperty(value = "signedResource") + private SignedResource resource; + + /* + * 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). + */ + @JsonProperty(value = "signedPermission") + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry") + private OffsetDateTime sharedAccessExpiryTime; + + /* + * A unique value up to 64 characters in length that correlates to an access policy specified for the container, + * queue, or table. + */ + @JsonProperty(value = "signedIdentifier") + private String identifier; + + /* + * The start of partition key. + */ + @JsonProperty(value = "startPk") + private String partitionKeyStart; + + /* + * The end of partition key. + */ + @JsonProperty(value = "endPk") + private String partitionKeyEnd; + + /* + * The start of row key. + */ + @JsonProperty(value = "startRk") + private String rowKeyStart; + + /* + * The end of row key. + */ + @JsonProperty(value = "endRk") + private String rowKeyEnd; + + /* + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /* + * The response header override for cache control. + */ + @JsonProperty(value = "rscc") + private String cacheControl; + + /* + * The response header override for content disposition. + */ + @JsonProperty(value = "rscd") + private String contentDisposition; + + /* + * The response header override for content encoding. + */ + @JsonProperty(value = "rsce") + private String contentEncoding; + + /* + * The response header override for content language. + */ + @JsonProperty(value = "rscl") + private String contentLanguage; + + /* + * The response header override for content type. + */ + @JsonProperty(value = "rsct") + private String contentType; + + /** + * Get the canonicalizedResource property: The canonical path to the signed resource. + * + * @return the canonicalizedResource value. + */ + public String canonicalizedResource() { + return this.canonicalizedResource; + } + + /** + * Set the canonicalizedResource property: The canonical path to the signed resource. + * + * @param canonicalizedResource the canonicalizedResource value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { + this.canonicalizedResource = canonicalizedResource; + return this; + } + + /** + * Get the resource property: The signed services accessible with the service SAS. Possible values include: Blob + * (b), Container (c), File (f), Share (s). + * + * @return the resource value. + */ + public SignedResource resource() { + return this.resource; + } + + /** + * Set the resource property: The signed services accessible with the service SAS. Possible values include: Blob + * (b), Container (c), File (f), Share (s). + * + * @param resource the resource value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withResource(SignedResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the permissions property: 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). + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: 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). + * + * @param permissions the permissions value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the protocols property: The protocol permitted for a request made with the account SAS. + * + * @return the protocols value. + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocols property: The protocol permitted for a request made with the account SAS. + * + * @param protocols the protocols value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value. + */ + public OffsetDateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value. + */ + public OffsetDateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the identifier property: A unique value up to 64 characters in length that correlates to an access policy + * specified for the container, queue, or table. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: A unique value up to 64 characters in length that correlates to an access policy + * specified for the container, queue, or table. + * + * @param identifier the identifier value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the partitionKeyStart property: The start of partition key. + * + * @return the partitionKeyStart value. + */ + public String partitionKeyStart() { + return this.partitionKeyStart; + } + + /** + * Set the partitionKeyStart property: The start of partition key. + * + * @param partitionKeyStart the partitionKeyStart value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { + this.partitionKeyStart = partitionKeyStart; + return this; + } + + /** + * Get the partitionKeyEnd property: The end of partition key. + * + * @return the partitionKeyEnd value. + */ + public String partitionKeyEnd() { + return this.partitionKeyEnd; + } + + /** + * Set the partitionKeyEnd property: The end of partition key. + * + * @param partitionKeyEnd the partitionKeyEnd value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { + this.partitionKeyEnd = partitionKeyEnd; + return this; + } + + /** + * Get the rowKeyStart property: The start of row key. + * + * @return the rowKeyStart value. + */ + public String rowKeyStart() { + return this.rowKeyStart; + } + + /** + * Set the rowKeyStart property: The start of row key. + * + * @param rowKeyStart the rowKeyStart value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyStart(String rowKeyStart) { + this.rowKeyStart = rowKeyStart; + return this; + } + + /** + * Get the rowKeyEnd property: The end of row key. + * + * @return the rowKeyEnd value. + */ + public String rowKeyEnd() { + return this.rowKeyEnd; + } + + /** + * Set the rowKeyEnd property: The end of row key. + * + * @param rowKeyEnd the rowKeyEnd value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { + this.rowKeyEnd = rowKeyEnd; + return this; + } + + /** + * Get the keyToSign property: The key to sign the account SAS token with. + * + * @return the keyToSign value. + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the keyToSign property: The key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Get the cacheControl property: The response header override for cache control. + * + * @return the cacheControl value. + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the cacheControl property: The response header override for cache control. + * + * @param cacheControl the cacheControl value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the contentDisposition property: The response header override for content disposition. + * + * @return the contentDisposition value. + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the contentDisposition property: The response header override for content disposition. + * + * @param contentDisposition the contentDisposition value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } + + /** + * Get the contentEncoding property: The response header override for content encoding. + * + * @return the contentEncoding value. + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the contentEncoding property: The response header override for content encoding. + * + * @param contentEncoding the contentEncoding value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the contentLanguage property: The response header override for content language. + * + * @return the contentLanguage value. + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the contentLanguage property: The response header override for content language. + * + * @param contentLanguage the contentLanguage value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the contentType property: The response header override for content type. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The response header override for content type. + * + * @param contentType the contentType value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (canonicalizedResource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property canonicalizedResource in model ServiceSasParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceSasParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java new file mode 100644 index 0000000000000..002511d0cce66 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include metric specifications. */ +@Fluent +public final class ServiceSpecification { + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java new file mode 100644 index 0000000000000..70c4fb3bc13ac --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Services. */ +public final class Services extends ExpandableStringEnum { + /** Static value b for Services. */ + public static final Services B = fromString("b"); + + /** Static value q for Services. */ + public static final Services Q = fromString("q"); + + /** Static value t for Services. */ + public static final Services T = fromString("t"); + + /** Static value f for Services. */ + public static final Services F = fromString("f"); + + /** + * Creates or finds a Services from its string representation. + * + * @param name a name to look for. + * @return the corresponding Services. + */ + @JsonCreator + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** + * Gets known Services values. + * + * @return known Services values. + */ + public static Collection values() { + return values(Services.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java new file mode 100644 index 0000000000000..374ef131801da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ShareAccessTier. */ +public final class ShareAccessTier extends ExpandableStringEnum { + /** Static value TransactionOptimized for ShareAccessTier. */ + public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); + + /** Static value Hot for ShareAccessTier. */ + public static final ShareAccessTier HOT = fromString("Hot"); + + /** Static value Cool for ShareAccessTier. */ + public static final ShareAccessTier COOL = fromString("Cool"); + + /** Static value Premium for ShareAccessTier. */ + public static final ShareAccessTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a ShareAccessTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareAccessTier. + */ + @JsonCreator + public static ShareAccessTier fromString(String name) { + return fromString(name, ShareAccessTier.class); + } + + /** + * Gets known ShareAccessTier values. + * + * @return known ShareAccessTier values. + */ + public static Collection values() { + return values(ShareAccessTier.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java new file mode 100644 index 0000000000000..1d25d2b718c0d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SignedIdentifier model. */ +@Fluent +public final class SignedIdentifier { + /* + * An unique identifier of the stored access policy. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Access policy + */ + @JsonProperty(value = "accessPolicy") + private AccessPolicy accessPolicy; + + /** + * Get the id property: An unique identifier of the stored access policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: An unique identifier of the stored access policy. + * + * @param id the id value to set. + * @return the SignedIdentifier object itself. + */ + public SignedIdentifier withId(String id) { + this.id = id; + return this; + } + + /** + * Get the accessPolicy property: Access policy. + * + * @return the accessPolicy value. + */ + public AccessPolicy accessPolicy() { + return this.accessPolicy; + } + + /** + * Set the accessPolicy property: Access policy. + * + * @param accessPolicy the accessPolicy value to set. + * @return the SignedIdentifier object itself. + */ + public SignedIdentifier withAccessPolicy(AccessPolicy accessPolicy) { + this.accessPolicy = accessPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessPolicy() != null) { + accessPolicy().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java new file mode 100644 index 0000000000000..60762aa0e872b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignedResource. */ +public final class SignedResource extends ExpandableStringEnum { + /** Static value b for SignedResource. */ + public static final SignedResource B = fromString("b"); + + /** Static value c for SignedResource. */ + public static final SignedResource C = fromString("c"); + + /** Static value f for SignedResource. */ + public static final SignedResource F = fromString("f"); + + /** Static value s for SignedResource. */ + public static final SignedResource S = fromString("s"); + + /** + * Creates or finds a SignedResource from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResource. + */ + @JsonCreator + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** + * Gets known SignedResource values. + * + * @return known SignedResource values. + */ + public static Collection values() { + return values(SignedResource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java new file mode 100644 index 0000000000000..c0082934bd763 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignedResourceTypes. */ +public final class SignedResourceTypes extends ExpandableStringEnum { + /** Static value s for SignedResourceTypes. */ + public static final SignedResourceTypes S = fromString("s"); + + /** Static value c for SignedResourceTypes. */ + public static final SignedResourceTypes C = fromString("c"); + + /** Static value o for SignedResourceTypes. */ + public static final SignedResourceTypes O = fromString("o"); + + /** + * Creates or finds a SignedResourceTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResourceTypes. + */ + @JsonCreator + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** + * Gets known SignedResourceTypes values. + * + * @return known SignedResourceTypes values. + */ + public static Collection values() { + return values(SignedResourceTypes.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java new file mode 100644 index 0000000000000..ae7618b680619 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU of the storage account. */ +@Fluent +public final class Sku { + /* + * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was + * called accountType. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java new file mode 100644 index 0000000000000..76cf32b54ccd0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + */ +@Immutable +public final class SkuCapability { + /* + * The name of capability, The capability information in the specified SKU, including file encryption, network + * ACLs, change notification, etc. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * A string value to indicate states of given capability. Possibly 'true' or 'false'. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: The name of capability, The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: A string value to indicate states of given capability. Possibly 'true' or 'false'. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java new file mode 100644 index 0000000000000..d0dc05ab49dad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuConversionStatus. */ +public final class SkuConversionStatus extends ExpandableStringEnum { + /** Static value InProgress for SkuConversionStatus. */ + public static final SkuConversionStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for SkuConversionStatus. */ + public static final SkuConversionStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for SkuConversionStatus. */ + public static final SkuConversionStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a SkuConversionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuConversionStatus. + */ + @JsonCreator + public static SkuConversionStatus fromString(String name) { + return fromString(name, SkuConversionStatus.class); + } + + /** + * Gets known SkuConversionStatus values. + * + * @return known SkuConversionStatus values. + */ + public static Collection values() { + return values(SkuConversionStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java new file mode 100644 index 0000000000000..d2576e72fea3a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import java.util.List; + +/** An immutable client-side representation of SkuInformation. */ +public interface SkuInformation { + /** + * Gets the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + SkuName name(); + + /** + * Gets the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + SkuTier tier(); + + /** + * Gets the resourceType property: The type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the kind property: Indicates the type of storage account. + * + * @return the kind value. + */ + Kind kind(); + + /** + * Gets the locations property: 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.). + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the capabilities property: The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner object. + * + * @return the inner object. + */ + SkuInformationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java new file mode 100644 index 0000000000000..e113e3344b1fc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Standard_LRS for SkuName. */ + public static final SkuName STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Standard_GRS for SkuName. */ + public static final SkuName STANDARD_GRS = fromString("Standard_GRS"); + + /** Static value Standard_RAGRS for SkuName. */ + public static final SkuName STANDARD_RAGRS = fromString("Standard_RAGRS"); + + /** Static value Standard_ZRS for SkuName. */ + public static final SkuName STANDARD_ZRS = fromString("Standard_ZRS"); + + /** Static value Premium_LRS for SkuName. */ + public static final SkuName PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Premium_ZRS for SkuName. */ + public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value Standard_GZRS for SkuName. */ + public static final SkuName STANDARD_GZRS = fromString("Standard_GZRS"); + + /** Static value Standard_RAGZRS for SkuName. */ + public static final SkuName STANDARD_RAGZRS = fromString("Standard_RAGZRS"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java new file mode 100644 index 0000000000000..a5917868bc829 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuTier. */ +public enum SkuTier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuTier instance. */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + @JsonCreator + public static SkuTier fromString(String value) { + if (value == null) { + return null; + } + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java new file mode 100644 index 0000000000000..339f5427dc90f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java new file mode 100644 index 0000000000000..0a6802eb5f769 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Setting for SMB protocol. */ +@Fluent +public final class SmbSetting { + /* + * Multichannel setting. Applies to Premium FileStorage only. + */ + @JsonProperty(value = "multichannel") + private Multichannel multichannel; + + /* + * SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a + * string with delimiter ';'. + */ + @JsonProperty(value = "versions") + private String versions; + + /* + * SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string + * with delimiter ';'. + */ + @JsonProperty(value = "authenticationMethods") + private String authenticationMethods; + + /* + * Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string + * with delimiter ';' + */ + @JsonProperty(value = "kerberosTicketEncryption") + private String kerberosTicketEncryption; + + /* + * 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 ';'. + */ + @JsonProperty(value = "channelEncryption") + private String channelEncryption; + + /** + * Get the multichannel property: Multichannel setting. Applies to Premium FileStorage only. + * + * @return the multichannel value. + */ + public Multichannel multichannel() { + return this.multichannel; + } + + /** + * Set the multichannel property: Multichannel setting. Applies to Premium FileStorage only. + * + * @param multichannel the multichannel value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withMultichannel(Multichannel multichannel) { + this.multichannel = multichannel; + return this; + } + + /** + * Get the versions property: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. + * Should be passed as a string with delimiter ';'. + * + * @return the versions value. + */ + public String versions() { + return this.versions; + } + + /** + * Set the versions property: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. + * Should be passed as a string with delimiter ';'. + * + * @param versions the versions value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withVersions(String versions) { + this.versions = versions; + return this; + } + + /** + * Get the authenticationMethods property: SMB authentication methods supported by server. Valid values are NTLMv2, + * Kerberos. Should be passed as a string with delimiter ';'. + * + * @return the authenticationMethods value. + */ + public String authenticationMethods() { + return this.authenticationMethods; + } + + /** + * Set the authenticationMethods property: SMB authentication methods supported by server. Valid values are NTLMv2, + * Kerberos. Should be passed as a string with delimiter ';'. + * + * @param authenticationMethods the authenticationMethods value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withAuthenticationMethods(String authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + * Get the kerberosTicketEncryption property: Kerberos ticket encryption supported by server. Valid values are + * RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + * + * @return the kerberosTicketEncryption value. + */ + public String kerberosTicketEncryption() { + return this.kerberosTicketEncryption; + } + + /** + * Set the kerberosTicketEncryption property: Kerberos ticket encryption supported by server. Valid values are + * RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + * + * @param kerberosTicketEncryption the kerberosTicketEncryption value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withKerberosTicketEncryption(String kerberosTicketEncryption) { + this.kerberosTicketEncryption = kerberosTicketEncryption; + return this; + } + + /** + * Get the channelEncryption property: 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 ';'. + * + * @return the channelEncryption value. + */ + public String channelEncryption() { + return this.channelEncryption; + } + + /** + * Set the channelEncryption property: 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 ';'. + * + * @param channelEncryption the channelEncryption value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withChannelEncryption(String channelEncryption) { + this.channelEncryption = channelEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (multichannel() != null) { + multichannel().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java new file mode 100644 index 0000000000000..fd5340022fecb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SshPublicKey model. */ +@Fluent +public final class SshPublicKey { + /* + * Optional. It is used to store the function/usage of the key + */ + @JsonProperty(value = "description") + private String description; + + /* + * Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the description property: Optional. It is used to store the function/usage of the key. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Optional. It is used to store the function/usage of the key. + * + * @param description the description value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the key property: Ssh public key base64 encoded. The format should be: '<keyType> <keyData>', + * e.g. ssh-rsa AAAABBBB. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Ssh public key base64 encoded. The format should be: '<keyType> <keyData>', + * e.g. ssh-rsa AAAABBBB. + * + * @param key the key value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKey(String key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java new file mode 100644 index 0000000000000..44818ec7eca46 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +public final class State extends ExpandableStringEnum { + /** Static value Provisioning for State. */ + public static final State PROVISIONING = fromString("Provisioning"); + + /** Static value Deprovisioning for State. */ + public static final State DEPROVISIONING = fromString("Deprovisioning"); + + /** Static value Succeeded for State. */ + public static final State SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for State. */ + public static final State FAILED = fromString("Failed"); + + /** Static value NetworkSourceDeleted for State. */ + public static final State NETWORK_SOURCE_DELETED = fromString("NetworkSourceDeleted"); + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java new file mode 100644 index 0000000000000..f4deec6462b48 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java @@ -0,0 +1,1358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of StorageAccount. */ +public interface StorageAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: Gets the SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the kind property: Gets the Kind. + * + * @return the kind value. + */ + Kind kind(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the primaryEndpoints property: 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. + * + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * Gets the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * Gets the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * Gets the lastGeoFailoverTime property: 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. + * + * @return the lastGeoFailoverTime value. + */ + OffsetDateTime lastGeoFailoverTime(); + + /** + * Gets the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * Gets the statusOfSecondary property: 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. + * + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * Gets the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * Gets the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + SasPolicy sasPolicy(); + + /** + * Gets the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + KeyPolicy keyPolicy(); + + /** + * Gets the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + KeyCreationTime keyCreationTime(); + + /** + * Gets the secondaryEndpoints property: 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. + * + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * Gets the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the accessTier property: 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. + * + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * Gets the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * Gets the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * Gets the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + Boolean isSftpEnabled(); + + /** + * Gets the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + Boolean isLocalUserEnabled(); + + /** + * Gets the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * Gets the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * Gets the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * Gets the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + LargeFileSharesState largeFileSharesState(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * Gets the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + + /** + * Gets the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + + /** + * Gets the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + + /** + * Gets the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + Boolean allowSharedKeyAccess(); + + /** + * Gets the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + Boolean enableNfsV3(); + + /** + * Gets the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + Boolean allowCrossTenantReplication(); + + /** + * Gets the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + Boolean defaultToOAuthAuthentication(); + + /** + * Gets the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageAccount immutableStorageWithVersioning(); + + /** + * Gets the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + AllowedCopyScope allowedCopyScope(); + + /** + * Gets the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus(); + + /** + * Gets the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + DnsEndpointType dnsEndpointType(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner object. + * + * @return the inner object. + */ + StorageAccountInner innerModel(); + + /** The entirety of the StorageAccount definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithKind, + DefinitionStages.WithCreate { + } + /** The StorageAccount definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageAccount definition. */ + interface Blank extends WithLocation { + } + /** The stage of the StorageAccount definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param 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. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param 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. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the StorageAccount definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the StorageAccount definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Required. Gets or sets the SKU name.. + * + * @param sku Required. Gets or sets the SKU name. + * @return the next definition stage. + */ + WithKind withSku(Sku sku); + } + /** The stage of the StorageAccount definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: Required. Indicates the type of storage account.. + * + * @param kind Required. Indicates the type of storage account. + * @return the next definition stage. + */ + WithCreate withKind(Kind kind); + } + /** + * The stage of the StorageAccount definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithAllowedCopyScope, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithSasPolicy, + DefinitionStages.WithKeyPolicy, + DefinitionStages.WithCustomDomain, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkRuleSet, + DefinitionStages.WithAccessTier, + DefinitionStages.WithAzureFilesIdentityBasedAuthentication, + DefinitionStages.WithEnableHttpsTrafficOnly, + DefinitionStages.WithIsSftpEnabled, + DefinitionStages.WithIsLocalUserEnabled, + DefinitionStages.WithIsHnsEnabled, + DefinitionStages.WithLargeFileSharesState, + DefinitionStages.WithRoutingPreference, + DefinitionStages.WithAllowBlobPublicAccess, + DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithAllowSharedKeyAccess, + DefinitionStages.WithEnableNfsV3, + DefinitionStages.WithAllowCrossTenantReplication, + DefinitionStages.WithDefaultToOAuthAuthentication, + DefinitionStages.WithImmutableStorageWithVersioning, + DefinitionStages.WithDnsEndpointType { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageAccount create(Context context); + } + /** The stage of the StorageAccount definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: 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.. + * + * @param tags 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. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the StorageAccount definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: 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. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the StorageAccount definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the StorageAccount definition allowing to specify allowedCopyScope. */ + interface WithAllowedCopyScope { + /** + * Specifies the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant + * or with Private Links to the same VNet.. + * + * @param allowedCopyScope Restrict copy to and from Storage Accounts within an AAD tenant or with Private + * Links to the same VNet. + * @return the next definition stage. + */ + WithCreate withAllowedCopyScope(AllowedCopyScope allowedCopyScope); + } + /** The stage of the StorageAccount definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow or disallow public network access to Storage Account. + * Value is optional but if passed in, must be 'Enabled' or 'Disabled'.. + * + * @param publicNetworkAccess Allow or disallow public network access to Storage Account. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the StorageAccount definition allowing to specify sasPolicy. */ + interface WithSasPolicy { + /** + * Specifies the sasPolicy property: SasPolicy assigned to the storage account.. + * + * @param sasPolicy SasPolicy assigned to the storage account. + * @return the next definition stage. + */ + WithCreate withSasPolicy(SasPolicy sasPolicy); + } + /** The stage of the StorageAccount definition allowing to specify keyPolicy. */ + interface WithKeyPolicy { + /** + * Specifies the keyPolicy property: KeyPolicy assigned to the storage account.. + * + * @param keyPolicy KeyPolicy assigned to the storage account. + * @return the next definition stage. + */ + WithCreate withKeyPolicy(KeyPolicy keyPolicy); + } + /** The stage of the StorageAccount definition allowing to specify customDomain. */ + interface WithCustomDomain { + /** + * Specifies the customDomain property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withCustomDomain(CustomDomain customDomain); + } + /** The stage of the StorageAccount definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption settings to be used for server-side encryption for the + * storage account.. + * + * @param encryption Encryption settings to be used for server-side encryption for the storage account. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + /** The stage of the StorageAccount definition allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: Network rule set. + * + * @param networkRuleSet Network rule set. + * @return the next definition stage. + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the StorageAccount definition allowing to specify accessTier. */ + interface WithAccessTier { + /** + * Specifies the accessTier property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withAccessTier(AccessTier accessTier); + } + /** The stage of the StorageAccount definition allowing to specify azureFilesIdentityBasedAuthentication. */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication + * settings for Azure Files.. + * + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for + * Azure Files. + * @return the next definition stage. + */ + WithCreate withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + /** The stage of the StorageAccount definition allowing to specify enableHttpsTrafficOnly. */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to + * true. The default value is true since API version 2019-04-01.. + * + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. The default + * value is true since API version 2019-04-01. + * @return the next definition stage. + */ + WithCreate withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + /** The stage of the StorageAccount definition allowing to specify isSftpEnabled. */ + interface WithIsSftpEnabled { + /** + * Specifies the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled Enables Secure File Transfer Protocol, if set to true. + * @return the next definition stage. + */ + WithCreate withIsSftpEnabled(Boolean isSftpEnabled); + } + /** The stage of the StorageAccount definition allowing to specify isLocalUserEnabled. */ + interface WithIsLocalUserEnabled { + /** + * Specifies the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled Enables local users feature, if set to true. + * @return the next definition stage. + */ + WithCreate withIsLocalUserEnabled(Boolean isLocalUserEnabled); + } + /** The stage of the StorageAccount definition allowing to specify isHnsEnabled. */ + interface WithIsHnsEnabled { + /** + * Specifies the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true.. + * + * @param isHnsEnabled Account HierarchicalNamespace enabled if sets to true. + * @return the next definition stage. + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + /** The stage of the StorageAccount definition allowing to specify largeFileSharesState. */ + interface WithLargeFileSharesState { + /** + * Specifies the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be + * disabled once it is enabled.. + * + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is + * enabled. + * @return the next definition stage. + */ + WithCreate withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + /** The stage of the StorageAccount definition allowing to specify routingPreference. */ + interface WithRoutingPreference { + /** + * Specifies the routingPreference property: Maintains information about the network routing choice opted by + * the user for data transfer. + * + * @param routingPreference Maintains information about the network routing choice opted by the user for + * data transfer. + * @return the next definition stage. + */ + WithCreate withRoutingPreference(RoutingPreference routingPreference); + } + /** The stage of the StorageAccount definition allowing to specify allowBlobPublicAccess. */ + interface WithAllowBlobPublicAccess { + /** + * Specifies the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers + * in the storage account. The default interpretation is true for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * @return the next definition stage. + */ + WithCreate withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** The stage of the StorageAccount definition allowing to specify minimumTlsVersion. */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to + * storage. The default interpretation is TLS 1.0 for this property.. + * + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default + * interpretation is TLS 1.0 for this property. + * @return the next definition stage. + */ + WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** The stage of the StorageAccount definition allowing to specify allowSharedKeyAccess. */ + interface WithAllowSharedKeyAccess { + /** + * Specifies the allowSharedKeyAccess property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withAllowSharedKeyAccess(Boolean allowSharedKeyAccess); + } + /** The stage of the StorageAccount definition allowing to specify enableNfsV3. */ + interface WithEnableNfsV3 { + /** + * Specifies the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true.. + * + * @param enableNfsV3 NFS 3.0 protocol support enabled if set to true. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3(Boolean enableNfsV3); + } + /** The stage of the StorageAccount definition allowing to specify allowCrossTenantReplication. */ + interface WithAllowCrossTenantReplication { + /** + * Specifies the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object + * replication. The default interpretation is true for this property.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * @return the next definition stage. + */ + WithCreate withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + /** The stage of the StorageAccount definition allowing to specify defaultToOAuthAuthentication. */ + interface WithDefaultToOAuthAuthentication { + /** + * Specifies the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default + * authentication is OAuth or not. The default interpretation is false for this property.. + * + * @param defaultToOAuthAuthentication A boolean flag which indicates whether the default authentication is + * OAuth or not. The default interpretation is false for this property. + * @return the next definition stage. + */ + WithCreate withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication); + } + /** The stage of the StorageAccount definition allowing to specify immutableStorageWithVersioning. */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning); + } + /** The stage of the StorageAccount definition allowing to specify dnsEndpointType. */ + interface WithDnsEndpointType { + /** + * Specifies the dnsEndpointType property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + WithCreate withDnsEndpointType(DnsEndpointType dnsEndpointType); + } + } + /** + * Begins update for the StorageAccount resource. + * + * @return the stage of resource update. + */ + StorageAccount.Update update(); + + /** The template for StorageAccount update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithKind, + UpdateStages.WithCustomDomain, + UpdateStages.WithEncryption, + UpdateStages.WithSasPolicy, + UpdateStages.WithKeyPolicy, + UpdateStages.WithAccessTier, + UpdateStages.WithAzureFilesIdentityBasedAuthentication, + UpdateStages.WithEnableHttpsTrafficOnly, + UpdateStages.WithIsSftpEnabled, + UpdateStages.WithIsLocalUserEnabled, + UpdateStages.WithNetworkRuleSet, + UpdateStages.WithLargeFileSharesState, + UpdateStages.WithRoutingPreference, + UpdateStages.WithAllowBlobPublicAccess, + UpdateStages.WithMinimumTlsVersion, + UpdateStages.WithAllowSharedKeyAccess, + UpdateStages.WithAllowCrossTenantReplication, + UpdateStages.WithDefaultToOAuthAuthentication, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithImmutableStorageWithVersioning, + UpdateStages.WithAllowedCopyScope, + UpdateStages.WithDnsEndpointType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageAccount apply(Context context); + } + /** The StorageAccount update stages. */ + interface UpdateStages { + /** The stage of the StorageAccount update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: 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.. + * + * @param tags 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. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the StorageAccount update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the StorageAccount update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the StorageAccount update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 + * value supported by server.. + * + * @param kind Optional. Indicates the type of storage account. Currently only StorageV2 value supported by + * server. + * @return the next definition stage. + */ + Update withKind(Kind kind); + } + /** The stage of the StorageAccount update allowing to specify customDomain. */ + interface WithCustomDomain { + /** + * Specifies the customDomain property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withCustomDomain(CustomDomain customDomain); + } + /** The stage of the StorageAccount update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default + * for all storage accounts and cannot be disabled.. + * + * @param encryption Not applicable. Azure Storage encryption at rest is enabled by default for all storage + * accounts and cannot be disabled. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + /** The stage of the StorageAccount update allowing to specify sasPolicy. */ + interface WithSasPolicy { + /** + * Specifies the sasPolicy property: SasPolicy assigned to the storage account.. + * + * @param sasPolicy SasPolicy assigned to the storage account. + * @return the next definition stage. + */ + Update withSasPolicy(SasPolicy sasPolicy); + } + /** The stage of the StorageAccount update allowing to specify keyPolicy. */ + interface WithKeyPolicy { + /** + * Specifies the keyPolicy property: KeyPolicy assigned to the storage account.. + * + * @param keyPolicy KeyPolicy assigned to the storage account. + * @return the next definition stage. + */ + Update withKeyPolicy(KeyPolicy keyPolicy); + } + /** The stage of the StorageAccount update allowing to specify accessTier. */ + interface WithAccessTier { + /** + * Specifies the accessTier property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withAccessTier(AccessTier accessTier); + } + /** The stage of the StorageAccount update allowing to specify azureFilesIdentityBasedAuthentication. */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication + * settings for Azure Files.. + * + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for + * Azure Files. + * @return the next definition stage. + */ + Update withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + /** The stage of the StorageAccount update allowing to specify enableHttpsTrafficOnly. */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to + * true.. + * + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. + * @return the next definition stage. + */ + Update withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + /** The stage of the StorageAccount update allowing to specify isSftpEnabled. */ + interface WithIsSftpEnabled { + /** + * Specifies the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled Enables Secure File Transfer Protocol, if set to true. + * @return the next definition stage. + */ + Update withIsSftpEnabled(Boolean isSftpEnabled); + } + /** The stage of the StorageAccount update allowing to specify isLocalUserEnabled. */ + interface WithIsLocalUserEnabled { + /** + * Specifies the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled Enables local users feature, if set to true. + * @return the next definition stage. + */ + Update withIsLocalUserEnabled(Boolean isLocalUserEnabled); + } + /** The stage of the StorageAccount update allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: Network rule set. + * + * @param networkRuleSet Network rule set. + * @return the next definition stage. + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the StorageAccount update allowing to specify largeFileSharesState. */ + interface WithLargeFileSharesState { + /** + * Specifies the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be + * disabled once it is enabled.. + * + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is + * enabled. + * @return the next definition stage. + */ + Update withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + /** The stage of the StorageAccount update allowing to specify routingPreference. */ + interface WithRoutingPreference { + /** + * Specifies the routingPreference property: Maintains information about the network routing choice opted by + * the user for data transfer. + * + * @param routingPreference Maintains information about the network routing choice opted by the user for + * data transfer. + * @return the next definition stage. + */ + Update withRoutingPreference(RoutingPreference routingPreference); + } + /** The stage of the StorageAccount update allowing to specify allowBlobPublicAccess. */ + interface WithAllowBlobPublicAccess { + /** + * Specifies the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers + * in the storage account. The default interpretation is true for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * @return the next definition stage. + */ + Update withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** The stage of the StorageAccount update allowing to specify minimumTlsVersion. */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to + * storage. The default interpretation is TLS 1.0 for this property.. + * + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default + * interpretation is TLS 1.0 for this property. + * @return the next definition stage. + */ + Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** The stage of the StorageAccount update allowing to specify allowSharedKeyAccess. */ + interface WithAllowSharedKeyAccess { + /** + * Specifies the allowSharedKeyAccess property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withAllowSharedKeyAccess(Boolean allowSharedKeyAccess); + } + /** The stage of the StorageAccount update allowing to specify allowCrossTenantReplication. */ + interface WithAllowCrossTenantReplication { + /** + * Specifies the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object + * replication. The default interpretation is true for this property.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * @return the next definition stage. + */ + Update withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + /** The stage of the StorageAccount update allowing to specify defaultToOAuthAuthentication. */ + interface WithDefaultToOAuthAuthentication { + /** + * Specifies the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default + * authentication is OAuth or not. The default interpretation is false for this property.. + * + * @param defaultToOAuthAuthentication A boolean flag which indicates whether the default authentication is + * OAuth or not. The default interpretation is false for this property. + * @return the next definition stage. + */ + Update withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication); + } + /** The stage of the StorageAccount update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow or disallow public network access to Storage Account. + * Value is optional but if passed in, must be 'Enabled' or 'Disabled'.. + * + * @param publicNetworkAccess Allow or disallow public network access to Storage Account. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the StorageAccount update allowing to specify immutableStorageWithVersioning. */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning); + } + /** The stage of the StorageAccount update allowing to specify allowedCopyScope. */ + interface WithAllowedCopyScope { + /** + * Specifies the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant + * or with Private Links to the same VNet.. + * + * @param allowedCopyScope Restrict copy to and from Storage Accounts within an AAD tenant or with Private + * Links to the same VNet. + * @return the next definition stage. + */ + Update withAllowedCopyScope(AllowedCopyScope allowedCopyScope); + } + /** The stage of the StorageAccount update allowing to specify dnsEndpointType. */ + interface WithDnsEndpointType { + /** + * Specifies the dnsEndpointType property: 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.. + * + * @param 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. + * @return the next definition stage. + */ + Update withDnsEndpointType(DnsEndpointType dnsEndpointType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageAccount refresh(Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + StorageAccountListKeysResult listKeys(); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + Response listKeysWithResponse(ListKeyExpand expand, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + StorageAccountListKeysResult regenerateKey(StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + Response regenerateKeyWithResponse( + StorageAccountRegenerateKeyParameters regenerateKey, Context context); + + /** + * List SAS credentials of a storage account. + * + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + ListAccountSasResponse listAccountSas(AccountSasParameters parameters); + + /** + * List SAS credentials of a storage account. + * + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + Response listAccountSasWithResponse(AccountSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + ListServiceSasResponse listServiceSas(ServiceSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param parameters The parameters to provide to list service SAS credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response}. + */ + Response listServiceSasWithResponse(ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters, Context context); + + /** + * Revoke user delegation keys. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeUserDelegationKeys(); + + /** + * Revoke user delegation keys. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response revokeUserDelegationKeysWithResponse(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..e36e5423d67a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to check the availability of the storage account name. */ +@Fluent +public final class StorageAccountCheckNameAvailabilityParameters { + /* + * The storage account name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.Storage/storageAccounts + */ + @JsonProperty(value = "type", required = true) + private String type = "Microsoft.Storage/storageAccounts"; + + /** Creates an instance of StorageAccountCheckNameAvailabilityParameters class. */ + public StorageAccountCheckNameAvailabilityParameters() { + type = "Microsoft.Storage/storageAccounts"; + } + + /** + * Get the name property: The storage account name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The storage account name. + * + * @param name the name value to set. + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Storage/storageAccounts. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.Storage/storageAccounts. + * + * @param type the type value to set. + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model StorageAccountCheckNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCheckNameAvailabilityParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java new file mode 100644 index 0000000000000..f21f3aa7e80aa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java @@ -0,0 +1,818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesCreateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used when creating a storage account. */ +@Fluent +public final class StorageAccountCreateParameters { + /* + * Required. Gets or sets the SKU name. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Required. Indicates the type of storage account. + */ + @JsonProperty(value = "kind", required = true) + private Kind kind; + + /* + * 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. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * 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 + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * 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. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The parameters used to create the storage account. + */ + @JsonProperty(value = "properties") + private StorageAccountPropertiesCreateParameters innerProperties; + + /** + * Get the sku property: Required. Gets or sets the SKU name. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Required. Gets or sets the SKU name. + * + * @param sku the sku value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: Required. Indicates the type of storage account. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Required. Indicates the type of storage account. + * + * @param kind the kind value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the location property: 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. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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. + * + * @param location the location value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the extendedLocation property: 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. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: 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. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the tags property: 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. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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. + * + * @param tags the tags value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The parameters used to create the storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesCreateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSasPolicy(SasPolicy sasPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withSasPolicy(sasPolicy); + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKeyPolicy(KeyPolicy keyPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withKeyPolicy(keyPolicy); + return this; + } + + /** + * Get the customDomain property: 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. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Set the customDomain property: 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. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withCustomDomain(customDomain); + return this; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @param encryption the encryption value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: 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. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsHnsEnabled(isHnsEnabled); + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3(); + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableNfsV3(Boolean enableNfsV3) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEnableNfsV3(enableNfsV3); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model StorageAccountCreateParameters")); + } else { + sku().validate(); + } + if (kind() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kind in model StorageAccountCreateParameters")); + } + if (location() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model StorageAccountCreateParameters")); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCreateParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java new file mode 100644 index 0000000000000..7c510d58e1f7e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for StorageAccountExpand. */ +public enum StorageAccountExpand { + /** Enum value geoReplicationStats. */ + GEO_REPLICATION_STATS("geoReplicationStats"), + + /** Enum value blobRestoreStatus. */ + BLOB_RESTORE_STATUS("blobRestoreStatus"); + + /** The actual serialized value for a StorageAccountExpand instance. */ + private final String value; + + StorageAccountExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountExpand object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountExpand fromString(String value) { + if (value == null) { + return null; + } + StorageAccountExpand[] items = StorageAccountExpand.values(); + for (StorageAccountExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java new file mode 100644 index 0000000000000..5327139a731ef --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing + * endpoint. + */ +@Immutable +public final class StorageAccountInternetEndpoints { + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java new file mode 100644 index 0000000000000..6520fe96ab4de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An access key for the storage account. */ +@Immutable +public final class StorageAccountKey { + /* + * Name of the key. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /* + * Base 64-encoded value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /* + * Permissions for the key -- read-only or full permissions. + */ + @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) + private KeyPermission permissions; + + /* + * Creation time of the key, in round trip date format. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /** + * Get the keyName property: Name of the key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Get the value property: Base 64-encoded value of the key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the permissions property: Permissions for the key -- read-only or full permissions. + * + * @return the permissions value. + */ + public KeyPermission permissions() { + return this.permissions; + } + + /** + * Get the creationTime property: Creation time of the key, in round trip date format. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java new file mode 100644 index 0000000000000..59780dcdb9ae9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import java.util.List; + +/** An immutable client-side representation of StorageAccountListKeysResult. */ +public interface StorageAccountListKeysResult { + /** + * Gets the keys property: Gets the list of storage account keys and their properties for the specified storage + * account. + * + * @return the keys value. + */ + List keys(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner + * object. + * + * @return the inner object. + */ + StorageAccountListKeysResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java new file mode 100644 index 0000000000000..f203ee0c26022 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Storage Accounts operation. */ +@Immutable +public final class StorageAccountListResult { + /* + * Gets the list of storage accounts and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Gets the list of storage accounts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: 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. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java new file mode 100644 index 0000000000000..5c9a5ffb81b19 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft + * routing endpoint. + */ +@Immutable +public final class StorageAccountMicrosoftEndpoints { + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /* + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the queue property: Gets the queue endpoint. + * + * @return the queue value. + */ + public String queue() { + return this.queue; + } + + /** + * Get the table property: Gets the table endpoint. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java new file mode 100644 index 0000000000000..21e983e90e0a8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of StorageAccountProperties. */ +public interface StorageAccountProperties { + /** + * Gets the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the primaryEndpoints property: 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. + * + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * Gets the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * Gets the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * Gets the lastGeoFailoverTime property: 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. + * + * @return the lastGeoFailoverTime value. + */ + OffsetDateTime lastGeoFailoverTime(); + + /** + * Gets the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * Gets the statusOfSecondary property: 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. + * + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * Gets the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * Gets the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + SasPolicy sasPolicy(); + + /** + * Gets the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + KeyPolicy keyPolicy(); + + /** + * Gets the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + KeyCreationTime keyCreationTime(); + + /** + * Gets the secondaryEndpoints property: 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. + * + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * Gets the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the accessTier property: 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. + * + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * Gets the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * Gets the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * Gets the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + Boolean isSftpEnabled(); + + /** + * Gets the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + Boolean isLocalUserEnabled(); + + /** + * Gets the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * Gets the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * Gets the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * Gets the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + LargeFileSharesState largeFileSharesState(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * Gets the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + + /** + * Gets the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + + /** + * Gets the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + + /** + * Gets the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + Boolean allowSharedKeyAccess(); + + /** + * Gets the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + Boolean enableNfsV3(); + + /** + * Gets the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + Boolean allowCrossTenantReplication(); + + /** + * Gets the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + Boolean defaultToOAuthAuthentication(); + + /** + * Gets the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageAccount immutableStorageWithVersioning(); + + /** + * Gets the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + AllowedCopyScope allowedCopyScope(); + + /** + * Gets the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus(); + + /** + * Gets the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + DnsEndpointType dnsEndpointType(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner object. + * + * @return the inner object. + */ + StorageAccountPropertiesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java new file mode 100644 index 0000000000000..b74bf84212f82 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to regenerate the storage account key. */ +@Fluent +public final class StorageAccountRegenerateKeyParameters { + /* + * The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, + * kerb1, kerb2. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, + * kerb1, kerb2. + * + * @param keyName the keyName value to set. + * @return the StorageAccountRegenerateKeyParameters object itself. + */ + public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyName in model StorageAccountRegenerateKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountRegenerateKeyParameters.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java new file mode 100644 index 0000000000000..25c07c8373a4a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This defines the sku conversion status object for asynchronous sku conversions. */ +@Fluent +public final class StorageAccountSkuConversionStatus { + /* + * This property indicates the current sku conversion status. + */ + @JsonProperty(value = "skuConversionStatus", access = JsonProperty.Access.WRITE_ONLY) + private SkuConversionStatus skuConversionStatus; + + /* + * This property represents the target sku name to which the account sku is being converted asynchronously. + */ + @JsonProperty(value = "targetSkuName") + private SkuName targetSkuName; + + /* + * This property represents the sku conversion start time. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * This property represents the sku conversion end time. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * Get the skuConversionStatus property: This property indicates the current sku conversion status. + * + * @return the skuConversionStatus value. + */ + public SkuConversionStatus skuConversionStatus() { + return this.skuConversionStatus; + } + + /** + * Get the targetSkuName property: This property represents the target sku name to which the account sku is being + * converted asynchronously. + * + * @return the targetSkuName value. + */ + public SkuName targetSkuName() { + return this.targetSkuName; + } + + /** + * Set the targetSkuName property: This property represents the target sku name to which the account sku is being + * converted asynchronously. + * + * @param targetSkuName the targetSkuName value to set. + * @return the StorageAccountSkuConversionStatus object itself. + */ + public StorageAccountSkuConversionStatus withTargetSkuName(SkuName targetSkuName) { + this.targetSkuName = targetSkuName; + return this; + } + + /** + * Get the startTime property: This property represents the sku conversion start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the endTime property: This property represents the sku conversion end time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java new file mode 100644 index 0000000000000..a8a35e5382cfc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java @@ -0,0 +1,690 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters that can be provided when updating the storage account properties. */ +@Fluent +public final class StorageAccountUpdateParameters { + /* + * 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. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * 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. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The parameters used when updating a storage account. + */ + @JsonProperty(value = "properties") + private StorageAccountPropertiesUpdateParameters innerProperties; + + /* + * Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /** + * Get the sku property: 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. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: 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. + * + * @param sku the sku value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: 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. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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. + * + * @param tags the tags value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The parameters used when updating a storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported + * by server. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported + * by server. + * + * @param kind the kind value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the customDomain property: 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. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Set the customDomain property: 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. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withCustomDomain(customDomain); + return this; + } + + /** + * Get the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @param encryption the encryption value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSasPolicy(SasPolicy sasPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withSasPolicy(sasPolicy); + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKeyPolicy(KeyPolicy keyPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withKeyPolicy(keyPolicy); + return this; + } + + /** + * Get the accessTier property: 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. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: 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. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: 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. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: 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. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to Storage Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: 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. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: 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. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withImmutableStorageWithVersioning( + ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the dnsEndpointType property: 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. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: 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. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java new file mode 100644 index 0000000000000..36357e14d8b5e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StorageAccounts. */ +public interface StorageAccounts { + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + CheckNameAvailabilityResult checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + StorageAccount getByResourceGroup(String resourceGroupName, String accountName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + StorageAccountListKeysResult listKeys(String resourceGroupName, String accountName); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation. + */ + StorageAccountListKeysResult regenerateKey( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListKeys operation along with {@link Response}. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + ListAccountSasResponse listAccountSas( + String resourceGroupName, String accountName, AccountSasParameters parameters); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + ListServiceSasResponse listServiceSas( + String resourceGroupName, String accountName, ServiceSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response}. + */ + Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(String resourceGroupName, String accountName); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void failover(String resourceGroupName, String accountName, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hierarchicalNamespaceMigration( + String resourceGroupName, String accountName, String requestType, Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(String resourceGroupName, String accountName, BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + BlobRestoreStatus restoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revokeUserDelegationKeys(String resourceGroupName, String accountName); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * 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. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + StorageAccount getById(String id); + + /** + * 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. + * + * @param id the resource ID. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, StorageAccountExpand expand, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageAccount resource. + * + * @param name resource name. + * @return the first stage of the new StorageAccount definition. + */ + StorageAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java new file mode 100644 index 0000000000000..cade98fe1dccc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import java.util.Map; + +/** An immutable client-side representation of StorageQueue. */ +public interface StorageQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the approximateMessageCount property: 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. + * + * @return the approximateMessageCount value. + */ + Integer approximateMessageCount(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner object. + * + * @return the inner object. + */ + StorageQueueInner innerModel(); + + /** The entirety of the StorageQueue definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The StorageQueue definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageQueue definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StorageQueue definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the StorageQueue definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithMetadata { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageQueue create(Context context); + } + /** The stage of the StorageQueue definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair that represents queue metadata.. + * + * @param metadata A name-value pair that represents queue metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + } + /** + * Begins update for the StorageQueue resource. + * + * @return the stage of resource update. + */ + StorageQueue.Update update(); + + /** The template for StorageQueue update. */ + interface Update extends UpdateStages.WithMetadata { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageQueue apply(Context context); + } + /** The StorageQueue update stages. */ + interface UpdateStages { + /** The stage of the StorageQueue update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair that represents queue metadata.. + * + * @param metadata A name-value pair that represents queue metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageQueue refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java new file mode 100644 index 0000000000000..7ae52f747daa1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Storage SKUs operation. */ +@Immutable +public final class StorageSkuListResult { + /* + * Get the list result of storage SKUs and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: Get the list result of storage SKUs and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java new file mode 100644 index 0000000000000..7ccfcc8417c3e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import java.util.List; + +/** An immutable client-side representation of Table. */ +public interface Table { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + String tableName(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.TableInner object. + * + * @return the inner object. + */ + TableInner innerModel(); + + /** The entirety of the Table definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Table definition stages. */ + interface DefinitionStages { + /** The first stage of the Table definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Table definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the Table definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithSignedIdentifiers { + /** + * Executes the create request. + * + * @return the created resource. + */ + Table create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Table create(Context context); + } + /** The stage of the Table definition allowing to specify signedIdentifiers. */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the table.. + * + * @param signedIdentifiers List of stored access policies specified on the table. + * @return the next definition stage. + */ + WithCreate withSignedIdentifiers(List signedIdentifiers); + } + } + /** + * Begins update for the Table resource. + * + * @return the stage of resource update. + */ + Table.Update update(); + + /** The template for Table update. */ + interface Update extends UpdateStages.WithSignedIdentifiers { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Table apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Table apply(Context context); + } + /** The Table update stages. */ + interface UpdateStages { + /** The stage of the Table update allowing to specify signedIdentifiers. */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the table.. + * + * @param signedIdentifiers List of stored access policies specified on the table. + * @return the next definition stage. + */ + Update withSignedIdentifiers(List signedIdentifiers); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Table refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Table refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java new file mode 100644 index 0000000000000..5a574290c4044 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Table Access Policy Properties Object. */ +@Fluent +public final class TableAccessPolicy { + /* + * Start time of the access policy + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Expiry time of the access policy + */ + @JsonProperty(value = "expiryTime") + private OffsetDateTime expiryTime; + + /* + * Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + */ + @JsonProperty(value = "permission", required = true) + private String permission; + + /** + * Get the startTime property: Start time of the access policy. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the access policy. + * + * @param startTime the startTime value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the expiryTime property: Expiry time of the access policy. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: Expiry time of the access policy. + * + * @param expiryTime the expiryTime value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the permission property: Required. List of abbreviated permissions. Supported permission values include + * 'r','a','u','d'. + * + * @return the permission value. + */ + public String permission() { + return this.permission; + } + + /** + * Set the permission property: Required. List of abbreviated permissions. Supported permission values include + * 'r','a','u','d'. + * + * @param permission the permission value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withPermission(String permission) { + this.permission = permission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permission() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property permission in model TableAccessPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableAccessPolicy.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java new file mode 100644 index 0000000000000..be158cbf038cb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; + +/** An immutable client-side representation of TableServiceProperties. */ +public interface TableServiceProperties { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the cors property: 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. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner object. + * + * @return the inner object. + */ + TableServicePropertiesInner innerModel(); + + /** The entirety of the TableServiceProperties definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TableServiceProperties definition stages. */ + interface DefinitionStages { + /** The first stage of the TableServiceProperties definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TableServiceProperties definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + /** + * The stage of the TableServiceProperties definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithCors { + /** + * Executes the create request. + * + * @return the created resource. + */ + TableServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TableServiceProperties create(Context context); + } + /** The stage of the TableServiceProperties definition allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + } + /** + * Begins update for the TableServiceProperties resource. + * + * @return the stage of resource update. + */ + TableServiceProperties.Update update(); + + /** The template for TableServiceProperties update. */ + interface Update extends UpdateStages.WithCors { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TableServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TableServiceProperties apply(Context context); + } + /** The TableServiceProperties update stages. */ + interface UpdateStages { + /** The stage of the TableServiceProperties update allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: 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.. + * + * @param cors 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. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TableServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TableServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java new file mode 100644 index 0000000000000..6dffc664dde4f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TableServices. */ +public interface TableServices { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ListTableServices list(String resourceGroupName, String accountName); + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + TableServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + TableServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TableServiceProperties resource. + * + * @return the first stage of the new TableServiceProperties definition. + */ + TableServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java new file mode 100644 index 0000000000000..94cd12a9a74e7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object to set Table Access Policy. */ +@Fluent +public final class TableSignedIdentifier { + /* + * unique-64-character-value of the stored access policy. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * Access policy + */ + @JsonProperty(value = "accessPolicy") + private TableAccessPolicy accessPolicy; + + /** + * Get the id property: unique-64-character-value of the stored access policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: unique-64-character-value of the stored access policy. + * + * @param id the id value to set. + * @return the TableSignedIdentifier object itself. + */ + public TableSignedIdentifier withId(String id) { + this.id = id; + return this; + } + + /** + * Get the accessPolicy property: Access policy. + * + * @return the accessPolicy value. + */ + public TableAccessPolicy accessPolicy() { + return this.accessPolicy; + } + + /** + * Set the accessPolicy property: Access policy. + * + * @param accessPolicy the accessPolicy value to set. + * @return the TableSignedIdentifier object itself. + */ + public TableSignedIdentifier withAccessPolicy(TableAccessPolicy accessPolicy) { + this.accessPolicy = accessPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model TableSignedIdentifier")); + } + if (accessPolicy() != null) { + accessPolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableSignedIdentifier.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java new file mode 100644 index 0000000000000..b50db63a078c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Tables. */ +public interface Tables { + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists. + */ + Table get(String resourceGroupName, String accountName, String tableName); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response}. + */ + Response

getWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable
list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all the tables under the specified storage account as paginated response with {@link + * PagedIterable}. + */ + PagedIterable
list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response}. + */ + Table getById(String id); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with {@link + * Response}. + */ + Response
getByIdWithResponse(String id, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Table resource. + * + * @param name resource name. + * @return the first stage of the new Table definition. + */ + Table.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java new file mode 100644 index 0000000000000..945a883e51cca --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob index tag based filtering for blob objects. */ +@Fluent +public final class TagFilter { + /* + * This is the filter tag name, it can have 1 - 128 characters + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) + * is currently supported + */ + @JsonProperty(value = "op", required = true) + private String op; + + /* + * This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: This is the filter tag name, it can have 1 - 128 characters. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: This is the filter tag name, it can have 1 - 128 characters. + * + * @param name the name value to set. + * @return the TagFilter object itself. + */ + public TagFilter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the op property: This is the comparison operator which is used for object comparison and filtering. Only == + * (equality operator) is currently supported. + * + * @return the op value. + */ + public String op() { + return this.op; + } + + /** + * Set the op property: This is the comparison operator which is used for object comparison and filtering. Only == + * (equality operator) is currently supported. + * + * @param op the op value to set. + * @return the TagFilter object itself. + */ + public TagFilter withOp(String op) { + this.op = op; + return this; + } + + /** + * Get the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 + * characters. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 + * characters. + * + * @param value the value value to set. + * @return the TagFilter object itself. + */ + public TagFilter withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model TagFilter")); + } + if (op() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property op in model TagFilter")); + } + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model TagFilter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TagFilter.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java new file mode 100644 index 0000000000000..15ba30c82a0c2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A tag of the LegalHold of a blob container. */ +@Immutable +public final class TagProperty { + /* + * The tag value. + */ + @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) + private String tag; + + /* + * Returns the date and time the tag was added. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who added the tag. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who added the tag. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Returns the User Principal Name of the user who added the tag. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * Get the tag property: The tag value. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Get the timestamp property: Returns the date and time the tag was added. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the objectIdentifier property: Returns the Object ID of the user who added the tag. + * + * @return the objectIdentifier value. + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get the tenantId property: Returns the Tenant ID that issued the token for the user who added the tag. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the upn property: Returns the User Principal Name of the user who added the tag. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java new file mode 100644 index 0000000000000..ac0e2488ea1b8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An update history of the ImmutabilityPolicy of a blob container. */ +@Fluent +public final class UpdateHistoryProperty { + /* + * The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + */ + @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyUpdateType update; + + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * Returns the date and time the ImmutabilityPolicy was updated. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /* + * 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. + */ + @JsonProperty(value = "allowProtectedAppendWritesAll") + private Boolean allowProtectedAppendWritesAll; + + /** + * Get the update property: The ImmutabilityPolicy update type of a blob container, possible values include: put, + * lock and extend. + * + * @return the update value. + */ + public ImmutabilityPolicyUpdateType update() { + return this.update; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Get the timestamp property: Returns the date and time the ImmutabilityPolicy was updated. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the objectIdentifier property: Returns the Object ID of the user who updated the ImmutabilityPolicy. + * + * @return the objectIdentifier value. + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get the tenantId property: Returns the Tenant ID that issued the token for the user who updated the + * ImmutabilityPolicy. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the upn property: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Get the allowProtectedAppendWrites property: 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. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: 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. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the UpdateHistoryProperty object itself. + */ + public UpdateHistoryProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: 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. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: 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. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the UpdateHistoryProperty object itself. + */ + public UpdateHistoryProperty withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java new file mode 100644 index 0000000000000..b1cc83b21b53e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; + +/** An immutable client-side representation of Usage. */ +public interface Usage { + /** + * Gets the unit property: Gets the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: Gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: Gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the name property: Gets the name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java new file mode 100644 index 0000000000000..c0c895222254c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Usages operation. */ +@Fluent +public final class UsageListResult { + /* + * Gets or sets the list of Storage Resource Usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Gets or sets the list of Storage Resource Usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of Storage Resource Usages. + * + * @param value the value value to set. + * @return the UsageListResult object itself. + */ + public UsageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java new file mode 100644 index 0000000000000..af2c0beb6daf8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names that can be used; currently limited to StorageAccount. */ +@Immutable +public final class UsageName { + /* + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /* + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the value property: Gets a string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue property: Gets a localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java new file mode 100644 index 0000000000000..48921f2e89e00 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UsageUnit. */ +public enum UsageUnit { + /** Enum value Count. */ + COUNT("Count"), + + /** Enum value Bytes. */ + BYTES("Bytes"), + + /** Enum value Seconds. */ + SECONDS("Seconds"), + + /** Enum value Percent. */ + PERCENT("Percent"), + + /** Enum value CountsPerSecond. */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** Enum value BytesPerSecond. */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** The actual serialized value for a UsageUnit instance. */ + private final String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + if (value == null) { + return null; + } + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java new file mode 100644 index 0000000000000..6805c717b7e58 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location); + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..c15f9a826e5dd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** UserAssignedIdentity for the resource. */ +@Immutable +public class UserAssignedIdentity { + /* + * The principal ID of the identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client ID of the identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal ID of the identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..ccb7e01b11eda --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Network rule. */ +@Fluent +public final class VirtualNetworkRule { + /* + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Gets the state of virtual network rule. + */ + @JsonProperty(value = "state") + private State state; + + /** + * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value. + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the state property: Gets the state of virtual network rule. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Gets the state of virtual network rule. + * + * @param state the state value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(State state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkResourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java new file mode 100644 index 0000000000000..dad9fc0c3748c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for StorageManagementClient. The Azure Storage Management API. */ +package com.azure.resourcemanager.storage.generated.models; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java new file mode 100644 index 0000000000000..74a9d5d7feb33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for StorageManagementClient. The Azure Storage Management API. */ +package com.azure.resourcemanager.storage.generated; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..fc9cba352e14e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.storage.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.storage.generated; + exports com.azure.resourcemanager.storage.generated.fluent; + exports com.azure.resourcemanager.storage.generated.fluent.models; + exports com.azure.resourcemanager.storage.generated.models; + + opens com.azure.resourcemanager.storage.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.storage.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java new file mode 100644 index 0000000000000..313066c4ec7db --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** Samples for BlobContainers ClearLegalHold. */ +public final class BlobContainersClearLegalHoldSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersClearLegalHold.json + */ + /** + * Sample code: ClearLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void clearLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .clearLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..73c90654fff81 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** Samples for BlobContainers CreateOrUpdateImmutabilityPolicy. */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutImmutabilityPolicy.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWrites(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutImmutabilityPolicyAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWritesAll(true) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java new file mode 100644 index 0000000000000..ccab8745142d8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; + +/** Samples for BlobContainers Create. */ +public final class BlobContainersCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutDefaultEncryptionScope.json + */ + /** + * Sample code: PutContainerWithDefaultEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainerWithDefaultEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withDefaultEncryptionScope("encryptionscope185") + .withDenyEncryptionScopeOverride(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPutObjectLevelWorm.json + */ + /** + * Sample code: PutContainerWithObjectLevelWorm. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainerWithObjectLevelWorm( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withImmutableStorageWithVersioning(new ImmutableStorageWithVersioning().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPut.json + */ + /** + * Sample code: PutContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().define("container6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..5de6a755bd6d9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers DeleteImmutabilityPolicy. */ +public final class BlobContainersDeleteImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersDeleteImmutabilityPolicy.json + */ + /** + * Sample code: DeleteImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .deleteImmutabilityPolicyWithResponse( + "res1581", "sto9621", "container4910", "\"8d59f81a7fa7be0\"", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java new file mode 100644 index 0000000000000..df5029092e3d4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers Delete. */ +public final class BlobContainersDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersDelete.json + */ + /** + * Sample code: DeleteContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().deleteWithResponse("res4079", "sto4506", "container9689", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..ae30e72d61cf2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** Samples for BlobContainers ExtendImmutabilityPolicy. */ +public final class BlobContainersExtendImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersExtendImmutabilityPolicy.json + */ + /** + * Sample code: ExtendImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void extendImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .extendImmutabilityPolicyWithResponse( + "res6238", + "sto232", + "container5023", + "\"8d59f830d0c3bf9\"", + new ImmutabilityPolicyInner().withImmutabilityPeriodSinceCreationInDays(100), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..2547edf62ecd3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers GetImmutabilityPolicy. */ +public final class BlobContainersGetImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGetImmutabilityPolicy.json + */ + /** + * Sample code: GetImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void getImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .getImmutabilityPolicyWithResponse("res5221", "sto9177", "container3489", null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java new file mode 100644 index 0000000000000..51d918eb86183 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers Get. */ +public final class BlobContainersGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGet.json + */ + /** + * Sample code: GetContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void getContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().getWithResponse("res9871", "sto6217", "container1634", Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersGetWithAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: GetBlobContainersGetWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobContainersGetWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().getWithResponse("res9871", "sto6217", "container1634", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java new file mode 100644 index 0000000000000..226bafbd15019 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequestAction; + +/** Samples for BlobContainers Lease. */ +public final class BlobContainersLeaseSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLease_Break.json + */ + /** + * Sample code: Break a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .leaseWithResponse( + "res3376", + "sto328", + "container6185", + new LeaseContainerRequest() + .withAction(LeaseContainerRequestAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .leaseWithResponse( + "res3376", + "sto328", + "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.ACQUIRE).withLeaseDuration(-1), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java new file mode 100644 index 0000000000000..dfc3f3b1b4b87 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** Samples for BlobContainers List. */ +public final class BlobContainersListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersList.json + */ + /** + * Sample code: ListContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedBlobContainersList.json + */ + /** + * Sample code: ListDeletedContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, ListContainersInclude.DELETED, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..a81e88ba3d1b4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers LockImmutabilityPolicy. */ +public final class BlobContainersLockImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersLockImmutabilityPolicy.json + */ + /** + * Sample code: LockImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void lockImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .lockImmutabilityPolicyWithResponse( + "res2702", "sto5009", "container1631", "\"8d59f825b721dd3\"", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java new file mode 100644 index 0000000000000..3353209896d13 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobContainers ObjectLevelWorm. */ +public final class BlobContainersObjectLevelWormSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/ObjectLevelWormContainerMigration.json + */ + /** + * Sample code: VersionLevelWormContainerMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void versionLevelWormContainerMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().objectLevelWorm("res1782", "sto7069", "container6397", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java new file mode 100644 index 0000000000000..28c5c4f2b876f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** Samples for BlobContainers SetLegalHold. */ +public final class BlobContainersSetLegalHoldSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersSetLegalHold.json + */ + /** + * Sample code: SetLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .setLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersSetLegalHoldAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: SetLegalHoldContainersWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainersWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobContainers() + .setLegalHoldWithResponse( + "res4303", + "sto7280", + "container8723", + new LegalHoldInner() + .withTags(Arrays.asList("tag1", "tag2", "tag3")) + .withAllowProtectedAppendWritesAll(true), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java new file mode 100644 index 0000000000000..915b1ddc0fdea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BlobContainers Update. */ +public final class BlobContainersUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobContainersPatch.json + */ + /** + * Sample code: UpdateContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void updateContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + BlobContainer resource = + manager.blobContainers().getWithResponse("res3376", "sto328", "container6185", Context.NONE).getValue(); + resource.update().withPublicAccess(PublicAccess.CONTAINER).withMetadata(mapOf("metadata", "true")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..0959840cfec61 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyRule; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.azure.resourcemanager.storage.generated.models.Format; +import com.azure.resourcemanager.storage.generated.models.InventoryRuleType; +import com.azure.resourcemanager.storage.generated.models.ObjectType; +import com.azure.resourcemanager.storage.generated.models.Schedule; +import java.util.Arrays; + +/** Samples for BlobInventoryPolicies CreateOrUpdate. */ +public final class BlobInventoryPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "Tags", + "ContentType", + "ContentEncoding", + "ContentLanguage", + "ContentCRC64", + "CacheControl", + "Metadata", + "Deleted", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold", + "Etag", + "DefaultEncryptionScope", + "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", + "Deleted", + "Version", + "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "Metadata"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema() + .withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules( + Arrays + .asList( + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFilters( + new BlobInventoryPolicyFilter() + .withPrefixMatch( + Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix( + Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays + .asList( + "Name", + "Creation-Time", + "Last-Modified", + "Content-Length", + "Content-MD5", + "BlobType", + "AccessTier", + "AccessTierChangeTime", + "Snapshot", + "VersionId", + "IsCurrentVersion", + "ContentType", + "ContentEncoding", + "ContentLanguage", + "ContentCRC64", + "CacheControl", + "Metadata", + "DeletionId", + "Deleted", + "DeletedTime", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule() + .withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition() + .withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields( + Arrays + .asList( + "Name", + "Last-Modified", + "Metadata", + "LeaseStatus", + "LeaseState", + "LeaseDuration", + "PublicAccess", + "HasImmutabilityPolicy", + "HasLegalHold", + "Etag", + "DefaultEncryptionScope", + "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", + "Deleted", + "Version", + "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..9f0372419115d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** Samples for BlobInventoryPolicies Delete. */ +public final class BlobInventoryPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountDeleteBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .deleteWithResponse("res6977", "sto2527", BlobInventoryPolicyName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java new file mode 100644 index 0000000000000..b45ee44ae8318 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** Samples for BlobInventoryPolicies Get. */ +public final class BlobInventoryPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobInventoryPolicies() + .getWithResponse("res7687", "sto9699", BlobInventoryPolicyName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java new file mode 100644 index 0000000000000..7af4f58465a52 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobInventoryPolicies List. */ +public final class BlobInventoryPoliciesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetBlobInventoryPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies().list("res7687", "sto9699", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..0476d1d73b03c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobServices GetServiceProperties. */ +public final class BlobServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesGet.json + */ + /** + * Sample code: GetBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java new file mode 100644 index 0000000000000..02fada5b25230 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for BlobServices List. */ +public final class BlobServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesList.json + */ + /** + * Sample code: ListBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().list("res4410", "sto8607", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..3381febcbbc83 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.Name; +import java.util.Arrays; + +/** Samples for BlobServices SetServiceProperties. */ +public final class BlobServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPut.json + */ + /** + * Sample code: PutBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x -ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .withDefaultServiceVersion("2017-07-29") + .withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(true).withDays(300)) + .withIsVersioningEnabled(true) + .withChangeFeed(new ChangeFeed().withEnabled(true).withRetentionInDays(7)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPutAllowPermanentDelete.json + */ + /** + * Sample code: BlobServicesPutAllowPermanentDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void blobServicesPutAllowPermanentDelete( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withDeleteRetentionPolicy( + new DeleteRetentionPolicy().withEnabled(true).withDays(300).withAllowPermanentDelete(true)) + .withIsVersioningEnabled(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobServicesPutLastAccessTimeBasedTracking.json + */ + /** + * Sample code: BlobServicesPutLastAccessTimeBasedTracking. + * + * @param manager Entry point to StorageManager. + */ + public static void blobServicesPutLastAccessTimeBasedTracking( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withLastAccessTimeTrackingPolicy( + new LastAccessTimeTrackingPolicy() + .withEnable(true) + .withName(Name.ACCESS_TIME_TRACKING) + .withTrackingGranularityInDays(1) + .withBlobType(Arrays.asList("blockBlob"))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java new file mode 100644 index 0000000000000..95c0ab213be5b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedAccounts Get. */ +public final class DeletedAccountsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedAccountGet.json + */ + /** + * Sample code: DeletedAccountGet. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().getWithResponse("sto1125", "eastus", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java new file mode 100644 index 0000000000000..de30b209f7caa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for DeletedAccounts List. */ +public final class DeletedAccountsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedAccountList.json + */ + /** + * Sample code: DeletedAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().list(Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java new file mode 100644 index 0000000000000..b647327b5a949 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for EncryptionScopes Get. */ +public final class EncryptionScopesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetEncryptionScope.json + */ + /** + * Sample code: StorageAccountGetEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .getWithResponse("resource-group-name", "{storage-account-name}", "{encryption-scope-name}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java new file mode 100644 index 0000000000000..01efe54e49f2e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for EncryptionScopes List. */ +public final class EncryptionScopesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEncryptionScopeList.json + */ + /** + * Sample code: StorageAccountEncryptionScopeList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEncryptionScopeList( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes().list("resource-group-name", "{storage-account-name}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java new file mode 100644 index 0000000000000..1b54532b62396 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; + +/** Samples for EncryptionScopes Patch. */ +public final class EncryptionScopesPatchSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPatchEncryptionScope.json + */ + /** + * Sample code: StorageAccountPatchEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPatchEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + EncryptionScope resource = + manager + .encryptionScopes() + .getWithResponse( + "resource-group-name", "{storage-account-name}", "{encryption-scope-name}", Context.NONE) + .getValue(); + resource + .update() + .withSource(EncryptionScopeSource.MICROSOFT_KEY_VAULT) + .withKeyVaultProperties( + new EncryptionScopeKeyVaultProperties() + .withKeyUri("https://testvault.vault.core.windows.net/keys/key1/863425f1358359c")) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java new file mode 100644 index 0000000000000..934c39b9e9089 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** Samples for EncryptionScopes Put. */ +public final class EncryptionScopesPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutEncryptionScopeWithInfrastructureEncryption.json + */ + /** + * Sample code: StorageAccountPutEncryptionScopeWithInfrastructureEncryption. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScopeWithInfrastructureEncryption( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "{storage-account-name}") + .withRequireInfrastructureEncryption(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutEncryptionScope.json + */ + /** + * Sample code: StorageAccountPutEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScope( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "{storage-account-name}") + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..d35fc1c7cfcdd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FileServices GetServiceProperties. */ +public final class FileServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesGet.json + */ + /** + * Sample code: GetFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java new file mode 100644 index 0000000000000..2e16dafc269e6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FileServices List. */ +public final class FileServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesList.json + */ + /** + * Sample code: ListFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..a770f143a35e9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.Multichannel; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.SmbSetting; +import java.util.Arrays; + +/** Samples for FileServices SetServiceProperties. */ +public final class FileServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut.json + */ + /** + * Sample code: PutFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut_EnableSecureSmbFeatures.json + */ + /** + * Sample code: PutFileServices_EnableSecureSmbFeatures. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServicesEnableSecureSmbFeatures( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings() + .withSmb( + new SmbSetting() + .withVersions("SMB2.1;SMB3.0;SMB3.1.1") + .withAuthenticationMethods("NTLMv2;Kerberos") + .withKerberosTicketEncryption("RC4-HMAC;AES-256") + .withChannelEncryption("AES-128-CCM;AES-128-GCM;AES-256-GCM"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileServicesPut_EnableSMBMultichannel.json + */ + /** + * Sample code: PutFileServices_EnableSMBMultichannel. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServicesEnableSMBMultichannel( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings().withSmb(new SmbSetting().withMultichannel(new Multichannel().withEnabled(true)))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java new file mode 100644 index 0000000000000..e69e23edbf8bb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; + +/** Samples for FileShares Create. */ +public final class FileSharesCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut_AccessTier.json + */ + /** + * Sample code: PutShares with Access Tier. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithAccessTier(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withAccessTier(ShareAccessTier.HOT) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut_NFS.json + */ + /** + * Sample code: Create NFS Shares. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withEnabledProtocols(EnabledProtocols.NFS) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPut.json + */ + /** + * Sample code: PutShares. + * + * @param manager Entry point to StorageManager. + */ + public static void putShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().define("share6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java new file mode 100644 index 0000000000000..279837c2257a3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FileShares Delete. */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesDelete.json + */ + /** + * Sample code: DeleteShares. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().deleteWithResponse("res4079", "sto4506", "share9689", null, null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java new file mode 100644 index 0000000000000..45e15eb5b1b26 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FileShares Get. */ +public final class FileSharesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesGet_Stats.json + */ + /** + * Sample code: GetShareStats. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareStats(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().getWithResponse("res9871", "sto6217", "share1634", "stats", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesGet.json + */ + /** + * Sample code: GetShares. + * + * @param manager Entry point to StorageManager. + */ + public static void getShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().getWithResponse("res9871", "sto6217", "share1634", null, null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java new file mode 100644 index 0000000000000..cd959e08e54a5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LeaseShareAction; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** Samples for FileShares Lease. */ +public final class FileSharesLeaseSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesLease_Break.json + */ + /** + * Sample code: Break a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .leaseWithResponse( + "res3376", + "sto328", + "share12", + null, + new LeaseShareRequest() + .withAction(LeaseShareAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .leaseWithResponse( + "res3376", + "sto328", + "share124", + null, + new LeaseShareRequest().withAction(LeaseShareAction.ACQUIRE).withLeaseDuration(-1), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java new file mode 100644 index 0000000000000..4e371f9335cd3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for FileShares List. */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesList.json + */ + /** + * Sample code: ListShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/DeletedFileSharesList.json + */ + /** + * Sample code: ListDeletedShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "deleted", Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileShareSnapshotsList.json + */ + /** + * Sample code: ListShareSnapshots. + * + * @param manager Entry point to StorageManager. + */ + public static void listShareSnapshots(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "snapshots", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java new file mode 100644 index 0000000000000..506f646214f2d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; + +/** Samples for FileShares Restore. */ +public final class FileSharesRestoreSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesRestore.json + */ + /** + * Sample code: RestoreShares. + * + * @param manager Entry point to StorageManager. + */ + public static void restoreShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .fileShares() + .restoreWithResponse( + "res3376", + "sto328", + "share1249", + new DeletedShare().withDeletedShareName("share1249").withDeletedShareVersion("1234567890"), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java new file mode 100644 index 0000000000000..8fb88218d43dc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccessPolicy; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for FileShares Update. */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileSharesPatch.json + */ + /** + * Sample code: UpdateShares. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = + manager.fileShares().getWithResponse("res3376", "sto328", "share6185", null, null, Context.NONE).getValue(); + resource.update().withMetadata(mapOf("type", "image")).apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/FileShareAclsPatch.json + */ + /** + * Sample code: UpdateShareAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = + manager.fileShares().getWithResponse("res3376", "sto328", "share6185", null, null, Context.NONE).getValue(); + resource + .update() + .withSignedIdentifiers( + Arrays + .asList( + new SignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new AccessPolicy() + .withStartTime(OffsetDateTime.parse("2021-04-01T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2021-05-01T08:49:37.0000000Z")) + .withPermission("rwd")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2820f4f979bbb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Arrays; + +/** Samples for LocalUsersOperation CreateOrUpdate. */ +public final class LocalUsersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserCreate.json + */ + /** + * Sample code: CreateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withPermissionScopes( + Arrays + .asList( + new PermissionScope().withPermissions("rwd").withService("file").withResourceName("share1"), + new PermissionScope().withPermissions("rw").withService("file").withResourceName("share2"))) + .withHomeDirectory("homedirectory") + .withSshAuthorizedKeys( + Arrays.asList(new SshPublicKey().withDescription("key name").withKey("ssh-rsa keykeykeykeykey="))) + .withHasSshPassword(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserUpdate.json + */ + /** + * Sample code: UpdateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void updateLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + LocalUser resource = + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", Context.NONE).getValue(); + resource + .update() + .withHomeDirectory("homedirectory2") + .withHasSharedKey(false) + .withHasSshKey(false) + .withHasSshPassword(false) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java new file mode 100644 index 0000000000000..dc087bb741b47 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation Delete. */ +public final class LocalUsersOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserDelete.json + */ + /** + * Sample code: DeleteLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().deleteWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java new file mode 100644 index 0000000000000..ec13c67a6ce88 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation Get. */ +public final class LocalUsersOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserGet.json + */ + /** + * Sample code: GetLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void getLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java new file mode 100644 index 0000000000000..312a19c6f2338 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation ListKeys. */ +public final class LocalUsersOperationListKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserListKeys.json + */ + /** + * Sample code: ListLocalUserKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUserKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().listKeysWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java new file mode 100644 index 0000000000000..ce42e4f43db92 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation List. */ +public final class LocalUsersOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUsersList.json + */ + /** + * Sample code: ListLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().list("res6977", "sto2527", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java new file mode 100644 index 0000000000000..0f16fff0cab84 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for LocalUsersOperation RegeneratePassword. */ +public final class LocalUsersOperationRegeneratePasswordSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/LocalUserRegeneratePassword.json + */ + /** + * Sample code: RegenerateLocalUserPassword. + * + * @param manager Entry point to StorageManager. + */ + public static void regenerateLocalUserPassword(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().regeneratePasswordWithResponse("res6977", "sto2527", "user1", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3b05ecaa99027 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.DateAfterCreation; +import com.azure.resourcemanager.storage.generated.models.DateAfterModification; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyAction; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyBaseBlob; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyRule; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySnapShot; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyVersion; +import com.azure.resourcemanager.storage.generated.models.RuleType; +import com.azure.resourcemanager.storage.generated.models.TagFilter; +import java.util.Arrays; + +/** Samples for ManagementPolicies CreateOrUpdate. */ +public final class ManagementPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicyWithSnapshotAndVersion.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyWithSnapshotAndVersion. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyWithSnapshotAndVersion( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withTierToCool( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(1000f))) + .withVersion( + new ManagementPolicyVersion() + .withTierToCool( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(1000f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicyForBlockAndAppendBlobs.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyForBlockAndAppendBlobs. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyForBlockAndAppendBlobs( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f))) + .withVersion( + new ManagementPolicyVersion() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(90f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastAccessTimeBasedBlobActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(1000.0F)) + .withEnableAutoTierToHotFromCool(true)) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy.json + */ + /** + * Sample code: StorageAccountSetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withDelete( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob")))), + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest2") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer2")) + .withBlobTypes(Arrays.asList("blockBlob")) + .withBlobIndexMatch( + Arrays + .asList( + new TagFilter() + .withName("tag1") + .withOp("==") + .withValue("val1"), + new TagFilter() + .withName("tag2") + .withOp("==") + .withValue("val2")))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyBaseBlobDaysAfterCreationActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(90.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterCreationGreaterThan(1000.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountSetManagementPolicy_LastTierChangeTimeActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastTierChangeTimeActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastTierChangeTimeActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule() + .withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob() + .withTierToCool( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F) + .withDaysAfterLastTierChangeGreaterThan(120.0F)) + .withDelete( + new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot( + new ManagementPolicySnapShot() + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F))) + .withVersion( + new ManagementPolicyVersion() + .withTierToArchive( + new DateAfterCreation() + .withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..97ff6ee4da91b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** Samples for ManagementPolicies Delete. */ +public final class ManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteManagementPolicy.json + */ + /** + * Sample code: StorageAccountDeleteManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .managementPolicies() + .deleteWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java new file mode 100644 index 0000000000000..991630e2cfd76 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** Samples for ManagementPolicies Get. */ +public final class ManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetManagementPolicy.json + */ + /** + * Sample code: StorageAccountGetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetManagementPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies().getWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3d1ce9bdb67a7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.util.Arrays; + +/** Samples for ObjectReplicationPoliciesOperation CreateOrUpdate. */ +public final class ObjectReplicationPoliciesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .define("2a20bb73-5717-4635-985a-5d4cf777438f") + .withExistingStorageAccount("res7687", "src1122") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter() + .withPrefixMatch(Arrays.asList("blobA", "blobB")) + .withMinCreationTime("2020-02-19T16:05:00Z")))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .define("default") + .withExistingStorageAccount("res7687", "dst112") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res7687", "dst112", "2a20bb73-5717-4635-985a-5d4cf777438f", Context.NONE) + .getValue(); + resource + .update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule() + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res7687", "src1122", "2a20bb73-5717-4635-985a-5d4cf777438f", Context.NONE) + .getValue(); + resource + .update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays + .asList( + new ObjectReplicationPolicyRule() + .withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters( + new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule() + .withRuleId("cfbb4bc2-8b60-429f-b05a-d1e0942b33b2") + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java new file mode 100644 index 0000000000000..e18dcaf483002 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation Delete. */ +public final class ObjectReplicationPoliciesOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeleteObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountDeleteObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .deleteWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java new file mode 100644 index 0000000000000..2188d41b66cf0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation Get. */ +public final class ObjectReplicationPoliciesOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountGetObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .objectReplicationPoliciesOperations() + .getWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java new file mode 100644 index 0000000000000..073c66b0b2ca9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ObjectReplicationPoliciesOperation List. */ +public final class ObjectReplicationPoliciesOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListObjectReplicationPolicies.json + */ + /** + * Sample code: StorageAccountListObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations().list("res6977", "sto2527", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..88973459fbfa7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageManager. + */ + public static void operationsList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..751306d84c014 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDeletePrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountDeletePrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeletePrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..268edd68e725c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountGetPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..53e7fc590dba8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListPrivateEndpointConnections.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..a2de53e5218c5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountPutPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountPutPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutPrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageAccount("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java new file mode 100644 index 0000000000000..a55627f52fd27 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByStorageAccount. */ +public final class PrivateLinkResourcesListByStorageAccountSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateLinkResources( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateLinkResources().listByStorageAccountWithResponse("res6977", "sto2527", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java new file mode 100644 index 0000000000000..44749bef31dc2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for Queue Create. */ +public final class QueueCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPut.json + */ + /** + * Sample code: QueueOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().define("queue6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPutWithMetadata.json + */ + /** + * Sample code: QueueOperationPutWithMetadata. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPutWithMetadata( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .queues() + .define("queue6185") + .withExistingStorageAccount("res3376", "sto328") + .withMetadata(mapOf("sample1", "meta1", "sample2", "meta2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java new file mode 100644 index 0000000000000..0302f03bad979 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queue Delete. */ +public final class QueueDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationDelete.json + */ + /** + * Sample code: QueueOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().deleteWithResponse("res3376", "sto328", "queue6185", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java new file mode 100644 index 0000000000000..25a29762c9a15 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queue Get. */ +public final class QueueGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationGet.json + */ + /** + * Sample code: QueueOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().getWithResponse("res3376", "sto328", "queue6185", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java new file mode 100644 index 0000000000000..ad8e524ac37a6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Queue List. */ +public final class QueueListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationList.json + */ + /** + * Sample code: QueueOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().list("res9290", "sto328", null, null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..5419d3283be74 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for QueueServices GetServiceProperties. */ +public final class QueueServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesGet.json + */ + /** + * Sample code: QueueServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java new file mode 100644 index 0000000000000..5906931afeeee --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for QueueServices List. */ +public final class QueueServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesList.json + */ + /** + * Sample code: QueueServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..8aaa11a7ff640 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** Samples for QueueServices SetServiceProperties. */ +public final class QueueServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueServicesPut.json + */ + /** + * Sample code: QueueServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .queueServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java new file mode 100644 index 0000000000000..236835a00262c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +/** Samples for Queue Update. */ +public final class QueueUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/QueueOperationPatch.json + */ + /** + * Sample code: QueueOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageQueue resource = + manager.queues().getWithResponse("res3376", "sto328", "queue6185", Context.NONE).getValue(); + resource.update().apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java new file mode 100644 index 0000000000000..46ae186650965 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/SKUList.json + */ + /** + * Sample code: SkuList. + * + * @param manager Entry point to StorageManager. + */ + public static void skuList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.skus().list(Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java new file mode 100644 index 0000000000000..411bdd41cfebc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts AbortHierarchicalNamespaceMigration. */ +public final class StorageAccountsAbortHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountAbortHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountAbortHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().abortHierarchicalNamespaceMigration("res4228", "sto2434", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..cd478c0cb3c58 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; + +/** Samples for StorageAccounts CheckNameAvailability. */ +public final class StorageAccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCheckNameAvailability.json + */ + /** + * Sample code: StorageAccountCheckNameAvailability. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCheckNameAvailability( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .checkNameAvailabilityWithResponse( + new StorageAccountCheckNameAvailabilityParameters().withName("sto3363"), Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java new file mode 100644 index 0000000000000..87745c96a970c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.Bypass; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.storage.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAccounts Create. */ +public final class StorageAccountsCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/NfsV3AccountCreate.json + */ + /** + * Sample code: NfsV3AccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void nfsV3AccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withNetworkRuleSet( + new NetworkRuleSet() + .withBypass(Bypass.AZURE_SERVICES) + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withVirtualNetworkResourceId( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))) + .withIpRules(Arrays.asList()) + .withDefaultAction(DefaultAction.ALLOW)) + .withEnableHttpsTrafficOnly(false) + .withIsHnsEnabled(true) + .withEnableNfsV3(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreatePremiumBlockBlobStorage.json + */ + /** + * Sample code: StorageAccountCreatePremiumBlockBlobStorage. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreatePremiumBlockBlobStorage( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountCreateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateWithImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withImmutableStorageWithVersioning( + new ImmutableStorageAccount() + .withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties() + .withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.UNLOCKED) + .withAllowProtectedAppendWrites(true))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateAllowedCopyScopeToPrivateLink.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToPrivateLink. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToPrivateLink( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withAllowedCopyScope(AllowedCopyScope.PRIVATE_LINK) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreate.json + */ + /** + * Sample code: StorageAccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateEnablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateEnablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateEnablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToAAD( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto131918") + .withRegion("eastus") + .withExistingResourceGroup("res131918") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("f83c6b1b-4d34-47e4-bb34-9d83df58b540"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDisallowPublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateDisallowPublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDisallowPublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDnsEndpointTypeToStandard.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToStandard. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToStandard( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.STANDARD) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateDnsEndpointTypeToAzureDnsZone.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToAzureDnsZone. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToAzureDnsZone( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "value1", "key2", "value2")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.AZURE_DNS_ZONE) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountCreateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java new file mode 100644 index 0000000000000..ab1bb04117f02 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts Delete. */ +public final class StorageAccountsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountDelete.json + */ + /** + * Sample code: StorageAccountDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().deleteWithResponse("res4228", "sto2434", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java new file mode 100644 index 0000000000000..f6e10fcdca636 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts Failover. */ +public final class StorageAccountsFailoverSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountFailover.json + */ + /** + * Sample code: StorageAccountFailover. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountFailover(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().failover("res4228", "sto2434", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..729a628f52de6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts GetByResourceGroup. */ +public final class StorageAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetProperties.json + */ + /** + * Sample code: StorageAccountGetProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPropertiesCMKVersionExpirationTime.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKVersionExpirationTime. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKVersionExpirationTime( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetAsyncSkuConversionStatus.json + */ + /** + * Sample code: StorageAccountGetAsyncSkuConversionStatus. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetAsyncSkuConversionStatus( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountGetPropertiesCMKEnabled.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKEnabled. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKEnabled( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java new file mode 100644 index 0000000000000..f97b5d5ecb40e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts HierarchicalNamespaceMigration. */ +public final class StorageAccountsHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .hierarchicalNamespaceMigration("res4228", "sto2434", "HnsOnValidationRequest", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java new file mode 100644 index 0000000000000..18500635a7453 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.HttpProtocol; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.Services; +import com.azure.resourcemanager.storage.generated.models.SignedResourceTypes; +import java.time.OffsetDateTime; + +/** Samples for StorageAccounts ListAccountSas. */ +public final class StorageAccountsListAccountSasSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListAccountSAS.json + */ + /** + * Sample code: StorageAccountListAccountSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListAccountSAS( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .listAccountSasWithResponse( + "res7985", + "sto8588", + new AccountSasParameters() + .withServices(Services.B) + .withResourceTypes(SignedResourceTypes.S) + .withPermissions(Permissions.R) + .withProtocols(HttpProtocol.HTTPS_HTTP) + .withSharedAccessStartTime(OffsetDateTime.parse("2017-05-24T10:42:03.1567373Z")) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:42:03.1567373Z")) + .withKeyToSign("key1"), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..68a962810f164 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts ListByResourceGroup. */ +public final class StorageAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListByResourceGroup.json + */ + /** + * Sample code: StorageAccountListByResourceGroup. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListByResourceGroup( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listByResourceGroup("res6117", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java new file mode 100644 index 0000000000000..5bcd8f384a152 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts ListKeys. */ +public final class StorageAccountsListKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListKeys.json + */ + /** + * Sample code: StorageAccountListKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listKeysWithResponse("res418", "sto2220", null, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java new file mode 100644 index 0000000000000..5fe0245bef1cc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts List. */ +public final class StorageAccountsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountList.json + */ + /** + * Sample code: StorageAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().list(Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java new file mode 100644 index 0000000000000..8704c922cdfcb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.SignedResource; +import java.time.OffsetDateTime; + +/** Samples for StorageAccounts ListServiceSas. */ +public final class StorageAccountsListServiceSasSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListServiceSAS.json + */ + /** + * Sample code: StorageAccountListServiceSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListServiceSAS( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .listServiceSasWithResponse( + "res7439", + "sto1299", + new ServiceSasParameters() + .withCanonicalizedResource("/blob/sto1299/music") + .withResource(SignedResource.C) + .withPermissions(Permissions.L) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:32:48.8457197Z")), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java new file mode 100644 index 0000000000000..37380776745a1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; + +/** Samples for StorageAccounts RegenerateKey. */ +public final class StorageAccountsRegenerateKeySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRegenerateKey.json + */ + /** + * Sample code: StorageAccountRegenerateKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .regenerateKeyWithResponse( + "res4167", "sto3539", new StorageAccountRegenerateKeyParameters().withKeyName("key2"), Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRegenerateKerbKey.json + */ + /** + * Sample code: StorageAccountRegenerateKerbKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKerbKey( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .regenerateKeyWithResponse( + "res4167", "sto3539", new StorageAccountRegenerateKeyParameters().withKeyName("kerb1"), Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java new file mode 100644 index 0000000000000..46ba7b947a3bb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for StorageAccounts RestoreBlobRanges. */ +public final class StorageAccountsRestoreBlobRangesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/BlobRangesRestore.json + */ + /** + * Sample code: BlobRangesRestore. + * + * @param manager Entry point to StorageManager. + */ + public static void blobRangesRestore(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .storageAccounts() + .restoreBlobRanges( + "res9101", + "sto4445", + new BlobRestoreParameters() + .withTimeToRestore(OffsetDateTime.parse("2019-04-20T15:30:00.0000000Z")) + .withBlobRanges( + Arrays + .asList( + new BlobRestoreRange() + .withStartRange("container/blobpath1") + .withEndRange("container/blobpath2"), + new BlobRestoreRange().withStartRange("container2/blobpath3").withEndRange(""))), + Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java new file mode 100644 index 0000000000000..56c6ea593ac35 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageAccounts RevokeUserDelegationKeys. */ +public final class StorageAccountsRevokeUserDelegationKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountRevokeUserDelegationKeys.json + */ + /** + * Sample code: StorageAccountRevokeUserDelegationKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRevokeUserDelegationKeys( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().revokeUserDelegationKeysWithResponse("res4167", "sto3539", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java new file mode 100644 index 0000000000000..9ec1bbc825eae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AccountType; +import com.azure.resourcemanager.storage.generated.models.ActiveDirectoryProperties; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DirectoryServiceOptions; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.ResourceAccessRule; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAccounts Update. */ +public final class StorageAccountsUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountUpdateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateWithImmutabilityPolicy( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withImmutableStorageWithVersioning( + new ImmutableStorageAccount() + .withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties() + .withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.LOCKED) + .withAllowProtectedAppendWrites(true))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res131918", "sto131918", null, Context.NONE) + .getValue(); + resource + .update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("3109d1c4-a5de-4d84-8832-feabb916a4b6"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEnableAD.json + */ + /** + * Sample code: StorageAccountEnableAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withAzureFilesIdentityBasedAuthentication( + new AzureFilesIdentityBasedAuthentication() + .withDirectoryServiceOptions(DirectoryServiceOptions.AD) + .withActiveDirectoryProperties( + new ActiveDirectoryProperties() + .withDomainName("adtest.com") + .withNetBiosDomainName("adtest.com") + .withForestName("adtest.com") + .withDomainGuid("aebfc118-9fa9-4732-a21f-d98e41a77ae1") + .withDomainSid("S-1-5-21-2400535526-2334094090-2402026252") + .withAzureStorageSid("S-1-5-21-2400535526-2334094090-2402026252-0012") + .withSamAccountName("sam12498") + .withAccountType(AccountType.USER))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountUpdateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateAllowedCopyScopeToAAD( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateDisablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountUpdateDisablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateDisablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountEnableCMK.json + */ + /** + * Sample code: StorageAccountEnableCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableCMK(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net"))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdate.json + */ + /** + * Sample code: StorageAccountUpdate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, Context.NONE) + .getValue(); + resource + .update() + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withIsSftpEnabled(true) + .withIsLocalUserEnabled(true) + .withNetworkRuleSet( + new NetworkRuleSet() + .withResourceAccessRules( + Arrays + .asList( + new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference( + new RoutingPreference() + .withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = + manager + .storageAccounts() + .getByResourceGroupWithResponse("res9101", "sto4445", null, Context.NONE) + .getValue(); + resource + .update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity( + new Identity() + .withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption( + new Encryption() + .withServices( + new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("wrappingKey") + .withKeyVersion("") + .withKeyVaultUri("https://myvault8569.vault.azure.net")) + .withEncryptionIdentity( + new EncryptionIdentity() + .withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java new file mode 100644 index 0000000000000..010f825dcc108 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Table Create. */ +public final class TableCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPut.json + */ + /** + * Sample code: TableOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().define("table6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPutOrPatchAcls.json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPutOrPatchAcls( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .tables() + .define("table6185") + .withExistingStorageAccount("res3376", "sto328") + .withSignedIdentifiers( + Arrays + .asList( + new TableSignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier() + .withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java new file mode 100644 index 0000000000000..c83ad9b16fb76 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Table Delete. */ +public final class TableDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationDelete.json + */ + /** + * Sample code: TableOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().deleteWithResponse("res3376", "sto328", "table6185", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java new file mode 100644 index 0000000000000..af949569c9a95 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Table Get. */ +public final class TableGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationGet.json + */ + /** + * Sample code: TableOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java new file mode 100644 index 0000000000000..5b4ef8d94ec7b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Table List. */ +public final class TableListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationList.json + */ + /** + * Sample code: TableOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().list("res9290", "sto328", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..9a662e014c072 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for TableServices GetServiceProperties. */ +public final class TableServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesGet.json + */ + /** + * Sample code: TableServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().getServicePropertiesWithResponse("res4410", "sto8607", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java new file mode 100644 index 0000000000000..18da01b28ad44 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for TableServices List. */ +public final class TableServicesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesList.json + */ + /** + * Sample code: TableServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().listWithResponse("res9290", "sto1590", Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..d764bf3127515 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** Samples for TableServices SetServiceProperties. */ +public final class TableServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableServicesPut.json + */ + /** + * Sample code: TableServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager + .tableServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors( + new CorsRules() + .withCorsRules( + Arrays + .asList( + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods( + Arrays + .asList( + AllowedMethods.GET, + AllowedMethods.HEAD, + AllowedMethods.POST, + AllowedMethods.OPTIONS, + AllowedMethods.MERGE, + AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule() + .withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule() + .withAllowedOrigins( + Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders( + Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java new file mode 100644 index 0000000000000..e15608e85b7f5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for Table Update. */ +public final class TableUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPutOrPatchAcls.json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPutOrPatchAcls( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE).getValue(); + resource + .update() + .withSignedIdentifiers( + Arrays + .asList( + new TableSignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier() + .withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy() + .withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/TableOperationPatch.json + */ + /** + * Sample code: TableOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables().getWithResponse("res3376", "sto328", "table6185", Context.NONE).getValue(); + resource.update().apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java new file mode 100644 index 0000000000000..558fc2eed9576 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Usages ListByLocation. */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-05-01/examples/StorageAccountListLocationUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to StorageManager. + */ + public static void usageList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.usages().listByLocation("eastus2(stage)", Context.NONE); + } +} diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index ccad15fa833da..02352b27ea66f 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -70,46 +70,50 @@ pr: - sdk/storage/azure-storage-queue/pom.xml parameters: -- name: release_azurestoragecommon - displayName: 'azure-storage-common' - type: boolean - default: true -- name: release_azurestorageblob - displayName: 'azure-storage-blob' - type: boolean - default: true -- name: release_azurestorageblobbatch - displayName: 'azure-storage-blob-batch' - type: boolean - default: true -- name: release_azurestorageblobchangefeed - displayName: 'azure-storage-blob-changefeed' - type: boolean - default: true -- name: release_azurestorageblobcryptography - displayName: 'azure-storage-blob-cryptography' - type: boolean - default: true -- name: release_azurestorageblobnio - displayName: 'azure-storage-blob-nio' - type: boolean - default: true -- name: release_azurestoragefileshare - displayName: 'azure-storage-file-share' - type: boolean - default: true -- name: release_azurestoragefiledatalake - displayName: 'azure-storage-file-datalake' - type: boolean - default: true -- name: release_azurestorageinternalavro - displayName: 'azure-storage-internal-avro' - type: boolean - default: true -- name: release_azurestoragequeue - displayName: 'azure-storage-queue' - type: boolean - default: true + - name: release_azurestoragecommon + displayName: azure-storage-common + type: boolean + default: true + - name: release_azurestorageblob + displayName: azure-storage-blob + type: boolean + default: true + - name: release_azurestorageblobbatch + displayName: azure-storage-blob-batch + type: boolean + default: true + - name: release_azurestorageblobchangefeed + displayName: azure-storage-blob-changefeed + type: boolean + default: true + - name: release_azurestorageblobcryptography + displayName: azure-storage-blob-cryptography + type: boolean + default: true + - name: release_azurestorageblobnio + displayName: azure-storage-blob-nio + type: boolean + default: true + - name: release_azurestoragefileshare + displayName: azure-storage-file-share + type: boolean + default: true + - name: release_azurestoragefiledatalake + displayName: azure-storage-file-datalake + type: boolean + default: true + - name: release_azurestorageinternalavro + displayName: azure-storage-internal-avro + type: boolean + default: true + - name: release_azurestoragequeue + displayName: azure-storage-queue + type: boolean + default: true + - name: release_azureresourcemanagerstoragegenerated + displayName: azure-resourcemanager-storage-generated + type: boolean + default: false extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -159,10 +163,13 @@ extends: groupId: com.azure safeName: azurestoragequeue releaseInBatch: ${{ parameters.release_azurestoragequeue }} + - name: azure-resourcemanager-storage-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerstoragegenerated }} AdditionalModules: - name: azure-storage-perf groupId: com.azure - # required by the above perf library - name: perf-test-core groupId: com.azure MatrixConfigs: diff --git a/sdk/storage/pom.xml b/sdk/storage/pom.xml index 3eb50438806d3..beb9006f2cbb3 100644 --- a/sdk/storage/pom.xml +++ b/sdk/storage/pom.xml @@ -9,17 +9,18 @@ pom 1.0.0 - azure-storage-common - azure-storage-blob - azure-storage-blob-batch - azure-storage-blob-changefeed - azure-storage-blob-cryptography - azure-storage-blob-nio - azure-storage-file-share - azure-storage-file-datalake - azure-storage-internal-avro - azure-storage-queue + azure-resourcemanager-storage-generated + azure-storage-blob + azure-storage-blob-batch + azure-storage-blob-changefeed + azure-storage-blob-cryptography + azure-storage-blob-nio + azure-storage-common + azure-storage-file-datalake + azure-storage-file-share + azure-storage-internal-avro azure-storage-perf + azure-storage-queue microsoft-azure-storage-blob microsoft-azure-storage-perf