diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md b/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md index f22f76062734..c3697a6a68de 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-04-01) +- Azure Resource Manager MediaServices client library for Java. This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.2 (2021-02-22) diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md b/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md index b2609498fa35..23f81680ff63 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager Mediaservices client library for Java +# Azure Resource Manager MediaServices client library for Java -Azure Resource Manager Mediaservices client library for Java. +Azure Resource Manager MediaServices client library for Java. -This package contains Microsoft Azure SDK for Mediaservices Management SDK. This Swagger was generated by the API Framework. Package tag package-2020-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-mediaservices - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -60,7 +60,7 @@ AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -MediaservicesManager manager = MediaservicesManager +MediaServicesManager manager = MediaServicesManager .authenticate(credential, profile); ``` diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml index b29143aa0c4c..21e65782c7fb 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml @@ -12,8 +12,8 @@ 1.0.0-beta.3 jar - Microsoft Azure SDK for Mediaservices Management - This package contains Microsoft Azure SDK for Mediaservices Management SDK. This Swagger was generated by the API Framework. Package tag package-2020-05. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + Microsoft Azure SDK for MediaServices Management + This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-2021-05. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaServicesManager.java similarity index 95% rename from sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java rename to sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaServicesManager.java index 4b186f870f95..d318957dbeda 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaservicesManager.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/MediaServicesManager.java @@ -60,8 +60,8 @@ import java.util.List; import java.util.Objects; -/** Entry point to MediaservicesManager. This Swagger was generated by the API Framework. */ -public final class MediaservicesManager { +/** Entry point to MediaServicesManager. This Swagger was generated by the API Framework. */ +public final class MediaServicesManager { private AccountFilters accountFilters; private Operations operations; @@ -96,7 +96,7 @@ public final class MediaservicesManager { private final AzureMediaServices clientObject; - private MediaservicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private MediaServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = @@ -109,25 +109,25 @@ private MediaservicesManager(HttpPipeline httpPipeline, AzureProfile profile, Du } /** - * Creates an instance of Mediaservices service API entry point. + * Creates an instance of MediaServices service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Mediaservices service API instance. + * @return the MediaServices service API instance. */ - public static MediaservicesManager authenticate(TokenCredential credential, AzureProfile profile) { + public static MediaServicesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Gets a Configurable instance that can be used to create MediaservicesManager with optional configuration. + * Gets a Configurable instance that can be used to create MediaServicesManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new MediaservicesManager.Configurable(); + return new MediaServicesManager.Configurable(); } /** The Configurable allowing configurations to be set. */ @@ -202,13 +202,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of Mediaservices service API entry point. + * Creates an instance of MediaServices service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Mediaservices service API instance. + * @return the MediaServices service API instance. */ - public MediaservicesManager authenticate(TokenCredential credential, AzureProfile profile) { + public MediaServicesManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -218,7 +218,7 @@ public MediaservicesManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.mediaservices") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -252,7 +252,7 @@ public MediaservicesManager authenticate(TokenCredential credential, AzureProfil .httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new MediaservicesManager(httpPipeline, profile, defaultPollInterval); + return new MediaServicesManager(httpPipeline, profile, defaultPollInterval); } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java index 8b471b588920..0371eb663c9d 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/AzureMediaServices.java @@ -23,13 +23,6 @@ public interface AzureMediaServices { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java index f038d4d34ce4..0d3c2c3e64f3 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/MediaservicesClient.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; +import com.azure.resourcemanager.mediaservices.models.MediaServiceUpdate; import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; /** An instance of this class provides access to all the operations defined in MediaservicesClient. */ @@ -137,7 +138,7 @@ Response createOrUpdateWithResponse( * @return a Media Services account. */ @ServiceMethod(returns = ReturnType.SINGLE) - MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters); + MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceUpdate parameters); /** * Updates an existing Media Services account. @@ -153,7 +154,7 @@ Response createOrUpdateWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( - String resourceGroupName, String accountName, MediaServiceInner parameters, Context context); + String resourceGroupName, String accountName, MediaServiceUpdate parameters, Context context); /** * Synchronizes storage account keys for a storage account associated with the Media Service account. @@ -235,29 +236,4 @@ Response listEdgePoliciesWithResponse( */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MediaServiceInner getBySubscription(String accountName); - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @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 details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBySubscriptionWithResponse(String accountName, Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java index 8fa01620441e..2f5568962d98 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AccountFilterInner.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; import com.azure.resourcemanager.mediaservices.models.FirstQuality; import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -121,9 +121,6 @@ public AccountFilterInner withTracks(List tracks) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (presentationTimeRange() != null) { presentationTimeRange().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java index 312db4541fdf..be566f6265db 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetFilterInner.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; import com.azure.resourcemanager.mediaservices.models.FirstQuality; import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -121,9 +121,6 @@ public AssetFilterInner withTracks(List tracks) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (presentationTimeRange() != null) { presentationTimeRange().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java index 1660d8ba7076..46786ef6cb8b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/AssetInner.java @@ -7,9 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.AssetStorageEncryptionFormat; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -206,8 +206,5 @@ public AssetStorageEncryptionFormat storageEncryptionFormat() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java index 2c1583cf4bdf..84ce6a6cc66f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/ContentKeyPolicyInner.java @@ -7,9 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -140,9 +140,6 @@ public ContentKeyPolicyInner withOptions(List options) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (options() != null) { options().forEach(e -> e.validate()); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java index bfac62f34868..b048a694c7e4 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/JobInner.java @@ -7,12 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.JobInput; import com.azure.resourcemanager.mediaservices.models.JobOutput; import com.azure.resourcemanager.mediaservices.models.JobState; import com.azure.resourcemanager.mediaservices.models.Priority; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -265,9 +265,6 @@ public OffsetDateTime endTime() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (input() != null) { input().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java index e0d77a91c349..e3bc48222309 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/LiveEventInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; import com.azure.resourcemanager.mediaservices.models.LiveEventEncoding; @@ -15,7 +16,6 @@ import com.azure.resourcemanager.mediaservices.models.LiveEventResourceState; import com.azure.resourcemanager.mediaservices.models.LiveEventTranscription; import com.azure.resourcemanager.mediaservices.models.StreamOptionsFlag; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -391,9 +391,6 @@ public LiveEventInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (input() != null) { input().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java index 31692cadded5..037d2aa8ad67 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/MediaServiceInner.java @@ -7,12 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.AccountEncryption; +import com.azure.resourcemanager.mediaservices.models.KeyDelivery; import com.azure.resourcemanager.mediaservices.models.MediaServiceIdentity; import com.azure.resourcemanager.mediaservices.models.StorageAccount; import com.azure.resourcemanager.mediaservices.models.StorageAuthentication; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -61,6 +62,12 @@ public class MediaServiceInner extends Resource { @JsonProperty(value = "properties.encryption") private AccountEncryption encryption; + /* + * The Key Delivery properties for Media Services account. + */ + @JsonProperty(value = "properties.keyDelivery") + private KeyDelivery keyDelivery; + /** * Get the identity property: The Managed Identity for the Media Services account. * @@ -159,6 +166,26 @@ public MediaServiceInner withEncryption(AccountEncryption encryption) { return this; } + /** + * Get the keyDelivery property: The Key Delivery properties for Media Services account. + * + * @return the keyDelivery value. + */ + public KeyDelivery keyDelivery() { + return this.keyDelivery; + } + + /** + * Set the keyDelivery property: The Key Delivery properties for Media Services account. + * + * @param keyDelivery the keyDelivery value to set. + * @return the MediaServiceInner object itself. + */ + public MediaServiceInner withKeyDelivery(KeyDelivery keyDelivery) { + this.keyDelivery = keyDelivery; + return this; + } + /** {@inheritDoc} */ @Override public MediaServiceInner withLocation(String location) { @@ -182,14 +209,14 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } if (storageAccounts() != null) { storageAccounts().forEach(e -> e.validate()); } if (encryption() != null) { encryption().validate(); } + if (keyDelivery() != null) { + keyDelivery().validate(); + } } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java index 89bcea6ac02f..b600e9eeaef2 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/OperationInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.mediaservices.models.ActionType; import com.azure.resourcemanager.mediaservices.models.OperationDisplay; import com.azure.resourcemanager.mediaservices.models.Properties; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -40,6 +41,18 @@ public final class OperationInner { @JsonProperty(value = "properties") private Properties properties; + /* + * Whether the operation applies to data-plane. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Indicates the action type. + */ + @JsonProperty(value = "actionType") + private ActionType actionType; + /** * Get the name property: The operation name. * @@ -120,6 +133,46 @@ public OperationInner withProperties(Properties properties) { return this; } + /** + * Get the isDataAction property: Whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Whether the operation applies to data-plane. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType property: Indicates the action type. + * + * @param actionType the actionType value to set. + * @return the OperationInner object itself. + */ + public OperationInner withActionType(ActionType actionType) { + this.actionType = actionType; + return this; + } + /** * Validates the instance. * diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java index 934ebac143f3..09d3a0129715 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingEndpointInner.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; import com.azure.resourcemanager.mediaservices.models.StreamingEndpointAccessControl; import com.azure.resourcemanager.mediaservices.models.StreamingEndpointResourceState; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -409,9 +409,6 @@ public StreamingEndpointInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (accessControl() != null) { accessControl().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java index 08c29ccc0bb7..683a4fb4c226 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingLocatorInner.java @@ -7,9 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -308,9 +308,6 @@ public StreamingLocatorInner withFilters(List filters) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (contentKeys() != null) { contentKeys().forEach(e -> e.validate()); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java index 430345d5c08a..71e99a50eaa9 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/StreamingPolicyInner.java @@ -7,12 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCbcs; import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCenc; import com.azure.resourcemanager.mediaservices.models.EnvelopeEncryption; import com.azure.resourcemanager.mediaservices.models.NoEncryption; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -189,9 +189,6 @@ public StreamingPolicyInner withNoEncryption(NoEncryption noEncryption) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (envelopeEncryption() != null) { envelopeEncryption().validate(); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java index 1db7204f98ae..bcbc457b633f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/fluent/models/TransformInner.java @@ -7,8 +7,8 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.azure.resourcemanager.mediaservices.models.TransformOutput; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -132,9 +132,6 @@ public TransformInner withOutputs(List outputs) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (systemData() != null) { - systemData().validate(); - } if (outputs() != null) { outputs().forEach(e -> e.validate()); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java index 92ef00cc2ca5..a7bf705f5492 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFilterImpl.java @@ -4,21 +4,20 @@ package com.azure.resourcemanager.mediaservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; import com.azure.resourcemanager.mediaservices.models.AccountFilter; import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; import com.azure.resourcemanager.mediaservices.models.FirstQuality; import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.util.Collections; import java.util.List; public final class AccountFilterImpl implements AccountFilter, AccountFilter.Definition, AccountFilter.Update { private AccountFilterInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -57,7 +56,7 @@ public AccountFilterInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -93,7 +92,7 @@ public AccountFilter create(Context context) { return this; } - AccountFilterImpl(String name, MediaservicesManager serviceManager) { + AccountFilterImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new AccountFilterInner(); this.serviceManager = serviceManager; this.filterName = name; @@ -123,7 +122,8 @@ public AccountFilter apply(Context context) { return this; } - AccountFilterImpl(AccountFilterInner innerObject, MediaservicesManager serviceManager) { + AccountFilterImpl( + AccountFilterInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java index e24c591a63ad..48356ab8f787 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersClientImpl.java @@ -186,6 +186,7 @@ private Mono> listSinglePageAsync(String resou if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -196,7 +197,7 @@ private Mono> listSinglePageAsync(String resou this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -208,7 +209,7 @@ private Mono> listSinglePageAsync(String resou res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -244,6 +245,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -252,7 +254,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -367,6 +369,7 @@ private Mono> getWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -378,10 +381,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -421,6 +424,7 @@ private Mono> getWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -430,7 +434,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -535,6 +539,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -546,11 +551,11 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -600,6 +605,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -609,7 +615,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -718,6 +724,7 @@ private Mono> deleteWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -729,10 +736,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -772,6 +779,7 @@ private Mono> deleteWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -781,7 +789,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -878,6 +886,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -889,11 +898,11 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -943,6 +952,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -952,7 +962,7 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1057,7 +1067,7 @@ private Mono> listNextSinglePageAsync(String n res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java index d239a5e7a097..68b790976798 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AccountFiltersImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.AccountFiltersClient; import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; import com.azure.resourcemanager.mediaservices.models.AccountFilter; @@ -21,9 +20,10 @@ public final class AccountFiltersImpl implements AccountFilters { private final AccountFiltersClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public AccountFiltersImpl(AccountFiltersClient innerClient, MediaservicesManager serviceManager) { + public AccountFiltersImpl( + AccountFiltersClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -183,7 +183,7 @@ private AccountFiltersClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java index 4b601819cf91..bf6099490ffc 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetContainerSasImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; import com.azure.resourcemanager.mediaservices.models.AssetContainerSas; import java.util.Collections; @@ -13,9 +12,11 @@ public final class AssetContainerSasImpl implements AssetContainerSas { private AssetContainerSasInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - AssetContainerSasImpl(AssetContainerSasInner innerObject, MediaservicesManager serviceManager) { + AssetContainerSasImpl( + AssetContainerSasInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -33,7 +34,7 @@ public AssetContainerSasInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java index 62a2eb8ed3b8..abd9c415f852 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFilterImpl.java @@ -4,21 +4,20 @@ package com.azure.resourcemanager.mediaservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; import com.azure.resourcemanager.mediaservices.models.AssetFilter; import com.azure.resourcemanager.mediaservices.models.FilterTrackSelection; import com.azure.resourcemanager.mediaservices.models.FirstQuality; import com.azure.resourcemanager.mediaservices.models.PresentationTimeRange; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.util.Collections; import java.util.List; public final class AssetFilterImpl implements AssetFilter, AssetFilter.Definition, AssetFilter.Update { private AssetFilterInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -57,7 +56,7 @@ public AssetFilterInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -98,7 +97,7 @@ public AssetFilter create(Context context) { return this; } - AssetFilterImpl(String name, MediaservicesManager serviceManager) { + AssetFilterImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new AssetFilterInner(); this.serviceManager = serviceManager; this.filterName = name; @@ -129,7 +128,8 @@ public AssetFilter apply(Context context) { return this; } - AssetFilterImpl(AssetFilterInner innerObject, MediaservicesManager serviceManager) { + AssetFilterImpl( + AssetFilterInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java index 80f1f82f78d7..63eb81cd9fc0 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersClientImpl.java @@ -196,6 +196,7 @@ private Mono> listSinglePageAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -207,7 +208,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -219,7 +220,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -259,6 +260,7 @@ private Mono> listSinglePageAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -268,7 +270,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -394,6 +396,7 @@ private Mono> getWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -406,10 +409,10 @@ private Mono> getWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -453,6 +456,7 @@ private Mono> getWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -463,7 +467,7 @@ private Mono> getWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -580,6 +584,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -592,11 +597,11 @@ private Mono> createOrUpdateWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -651,6 +656,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -661,7 +667,7 @@ private Mono> createOrUpdateWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -788,6 +794,7 @@ private Mono> deleteWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -800,10 +807,10 @@ private Mono> deleteWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -847,6 +854,7 @@ private Mono> deleteWithResponseAsync( if (filterName == null) { return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -857,7 +865,7 @@ private Mono> deleteWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -965,6 +973,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -977,11 +986,11 @@ private Mono> updateWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1036,6 +1045,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1046,7 +1056,7 @@ private Mono> updateWithResponseAsync( accountName, assetName, filterName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1164,7 +1174,7 @@ private Mono> listNextSinglePageAsync(String nex res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java index 735506847bcc..2ecd07eab27c 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetFiltersImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.AssetFiltersClient; import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; import com.azure.resourcemanager.mediaservices.models.AssetFilter; @@ -21,9 +20,10 @@ public final class AssetFiltersImpl implements AssetFilters { private final AssetFiltersClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public AssetFiltersImpl(AssetFiltersClient innerClient, MediaservicesManager serviceManager) { + public AssetFiltersImpl( + AssetFiltersClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -209,7 +209,7 @@ private AssetFiltersClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java index 9c1dc6b976d4..c6bc99bb4ba2 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetImpl.java @@ -4,24 +4,18 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; import com.azure.resourcemanager.mediaservices.models.Asset; -import com.azure.resourcemanager.mediaservices.models.AssetContainerSas; import com.azure.resourcemanager.mediaservices.models.AssetStorageEncryptionFormat; -import com.azure.resourcemanager.mediaservices.models.ListContainerSasInput; -import com.azure.resourcemanager.mediaservices.models.ListStreamingLocatorsResponse; -import com.azure.resourcemanager.mediaservices.models.StorageEncryptedAssetDecryptionData; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.UUID; public final class AssetImpl implements Asset, Asset.Definition, Asset.Update { private AssetInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -75,7 +69,7 @@ public AssetInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -111,7 +105,7 @@ public Asset create(Context context) { return this; } - AssetImpl(String name, MediaservicesManager serviceManager) { + AssetImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new AssetInner(); this.serviceManager = serviceManager; this.assetName = name; @@ -141,7 +135,7 @@ public Asset apply(Context context) { return this; } - AssetImpl(AssetInner innerObject, MediaservicesManager serviceManager) { + AssetImpl(AssetInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -169,34 +163,6 @@ public Asset refresh(Context context) { return this; } - public AssetContainerSas listContainerSas(ListContainerSasInput parameters) { - return serviceManager.assets().listContainerSas(resourceGroupName, accountName, assetName, parameters); - } - - public Response listContainerSasWithResponse(ListContainerSasInput parameters, Context context) { - return serviceManager - .assets() - .listContainerSasWithResponse(resourceGroupName, accountName, assetName, parameters, context); - } - - public StorageEncryptedAssetDecryptionData getEncryptionKey() { - return serviceManager.assets().getEncryptionKey(resourceGroupName, accountName, assetName); - } - - public Response getEncryptionKeyWithResponse(Context context) { - return serviceManager.assets().getEncryptionKeyWithResponse(resourceGroupName, accountName, assetName, context); - } - - public ListStreamingLocatorsResponse listStreamingLocators() { - return serviceManager.assets().listStreamingLocators(resourceGroupName, accountName, assetName); - } - - public Response listStreamingLocatorsWithResponse(Context context) { - return serviceManager - .assets() - .listStreamingLocatorsWithResponse(resourceGroupName, accountName, assetName, context); - } - public AssetImpl withAlternateId(String alternateId) { this.innerModel().withAlternateId(alternateId); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java index 297618fd3c27..2a2a50977c9f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java @@ -247,6 +247,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -257,7 +258,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -272,7 +273,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -312,6 +313,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -320,7 +322,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -477,6 +479,7 @@ private Mono> getWithResponseAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -488,10 +491,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -531,6 +534,7 @@ private Mono> getWithResponseAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -540,7 +544,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -645,6 +649,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -656,11 +661,11 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -706,6 +711,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -715,7 +721,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -820,6 +826,7 @@ private Mono> deleteWithResponseAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -831,10 +838,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -874,6 +881,7 @@ private Mono> deleteWithResponseAsync( if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -883,7 +891,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -980,6 +988,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -991,11 +1000,11 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1041,6 +1050,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1050,7 +1060,7 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1161,6 +1171,7 @@ private Mono> listContainerSasWithResponseAsync } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1172,11 +1183,11 @@ private Mono> listContainerSasWithResponseAsync resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1227,6 +1238,7 @@ private Mono> listContainerSasWithResponseAsync } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1236,7 +1248,7 @@ private Mono> listContainerSasWithResponseAsync resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1349,6 +1361,7 @@ private Mono> getEncryptionKe if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1360,10 +1373,10 @@ private Mono> getEncryptionKe resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1403,6 +1416,7 @@ private Mono> getEncryptionKe if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1412,7 +1426,7 @@ private Mono> getEncryptionKe resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1513,6 +1527,7 @@ private Mono> listStreamingLocators if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1524,10 +1539,10 @@ private Mono> listStreamingLocators resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1567,6 +1582,7 @@ private Mono> listStreamingLocators if (assetName == null) { return Mono.error(new IllegalArgumentException("Parameter assetName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1576,7 +1592,7 @@ private Mono> listStreamingLocators resourceGroupName, accountName, assetName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1673,7 +1689,7 @@ private Mono> listNextSinglePageAsync(String nextLink) res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java index c7cd1be0b16c..5ef058244fbc 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.AssetsClient; import com.azure.resourcemanager.mediaservices.fluent.models.AssetContainerSasInner; import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; @@ -28,9 +27,10 @@ public final class AssetsImpl implements Assets { private final AssetsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public AssetsImpl(AssetsClient innerClient, MediaservicesManager serviceManager) { + public AssetsImpl( + AssetsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -272,7 +272,7 @@ private AssetsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java index 883579bf4d55..d316d8fd8d83 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AzureMediaServicesImpl.java @@ -77,18 +77,6 @@ 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; @@ -339,7 +327,6 @@ public StreamingEndpointsClient getStreamingEndpoints() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-05-01"; this.accountFilters = new AccountFiltersClientImpl(this); this.operations = new OperationsClientImpl(this); this.mediaservices = new MediaservicesClientImpl(this); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java index daba8ce7e960..748ce1c2737b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesClientImpl.java @@ -212,6 +212,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -222,7 +223,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -237,7 +238,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -277,6 +278,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -285,7 +287,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -443,6 +445,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -454,10 +457,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -498,6 +501,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -507,7 +511,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -614,6 +618,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -625,11 +630,11 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -680,6 +685,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -689,7 +695,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -801,6 +807,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -812,10 +819,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -856,6 +863,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -865,7 +873,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -963,6 +971,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -974,11 +983,11 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1029,6 +1038,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1038,7 +1048,7 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1149,6 +1159,7 @@ private Mono> getPolicyPropertiesWithS return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1160,10 +1171,10 @@ private Mono> getPolicyPropertiesWithS resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1204,6 +1215,7 @@ private Mono> getPolicyPropertiesWithS return Mono .error(new IllegalArgumentException("Parameter contentKeyPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1213,7 +1225,7 @@ private Mono> getPolicyPropertiesWithS resourceGroupName, accountName, contentKeyPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1312,7 +1324,7 @@ private Mono> listNextSinglePageAsync(Strin res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java index 897fa5c0dec3..73a82b1a0a59 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPoliciesImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.ContentKeyPoliciesClient; import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; @@ -23,9 +22,11 @@ public final class ContentKeyPoliciesImpl implements ContentKeyPolicies { private final ContentKeyPoliciesClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public ContentKeyPoliciesImpl(ContentKeyPoliciesClient innerClient, MediaservicesManager serviceManager) { + public ContentKeyPoliciesImpl( + ContentKeyPoliciesClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -220,7 +221,7 @@ private ContentKeyPoliciesClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java index dd14f4ccfc89..a43becfe3b13 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyImpl.java @@ -4,14 +4,11 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicy; import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; -import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyProperties; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -21,7 +18,7 @@ public final class ContentKeyPolicyImpl implements ContentKeyPolicy, ContentKeyPolicy.Definition, ContentKeyPolicy.Update { private ContentKeyPolicyInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -68,7 +65,7 @@ public ContentKeyPolicyInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -106,7 +103,7 @@ public ContentKeyPolicy create(Context context) { return this; } - ContentKeyPolicyImpl(String name, MediaservicesManager serviceManager) { + ContentKeyPolicyImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new ContentKeyPolicyInner(); this.serviceManager = serviceManager; this.contentKeyPolicyName = name; @@ -137,7 +134,9 @@ public ContentKeyPolicy apply(Context context) { return this; } - ContentKeyPolicyImpl(ContentKeyPolicyInner innerObject, MediaservicesManager serviceManager) { + ContentKeyPolicyImpl( + ContentKeyPolicyInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -165,18 +164,6 @@ public ContentKeyPolicy refresh(Context context) { return this; } - public ContentKeyPolicyProperties getPolicyPropertiesWithSecrets() { - return serviceManager - .contentKeyPolicies() - .getPolicyPropertiesWithSecrets(resourceGroupName, accountName, contentKeyPolicyName); - } - - public Response getPolicyPropertiesWithSecretsWithResponse(Context context) { - return serviceManager - .contentKeyPolicies() - .getPolicyPropertiesWithSecretsWithResponse(resourceGroupName, accountName, contentKeyPolicyName, context); - } - public ContentKeyPolicyImpl withDescription(String description) { this.innerModel().withDescription(description); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java index 1895c3bb7b15..c3fef1b7a9f5 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ContentKeyPolicyPropertiesImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyPropertiesInner; import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyOption; import com.azure.resourcemanager.mediaservices.models.ContentKeyPolicyProperties; @@ -16,9 +15,11 @@ public final class ContentKeyPolicyPropertiesImpl implements ContentKeyPolicyProperties { private ContentKeyPolicyPropertiesInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - ContentKeyPolicyPropertiesImpl(ContentKeyPolicyPropertiesInner innerObject, MediaservicesManager serviceManager) { + ContentKeyPolicyPropertiesImpl( + ContentKeyPolicyPropertiesInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -52,7 +53,7 @@ public ContentKeyPolicyPropertiesInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java index 562e0951afd2..31fcbbf55946 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EdgePoliciesImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; import com.azure.resourcemanager.mediaservices.models.EdgePolicies; import com.azure.resourcemanager.mediaservices.models.EdgeUsageDataCollectionPolicy; @@ -12,9 +11,10 @@ public final class EdgePoliciesImpl implements EdgePolicies { private EdgePoliciesInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - EdgePoliciesImpl(EdgePoliciesInner innerObject, MediaservicesManager serviceManager) { + EdgePoliciesImpl( + EdgePoliciesInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -27,7 +27,7 @@ public EdgePoliciesInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java index 2943f6dd8a43..eecabce033da 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/EntityNameAvailabilityCheckOutputImpl.java @@ -4,17 +4,17 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; import com.azure.resourcemanager.mediaservices.models.EntityNameAvailabilityCheckOutput; public final class EntityNameAvailabilityCheckOutputImpl implements EntityNameAvailabilityCheckOutput { private EntityNameAvailabilityCheckOutputInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; EntityNameAvailabilityCheckOutputImpl( - EntityNameAvailabilityCheckOutputInner innerObject, MediaservicesManager serviceManager) { + EntityNameAvailabilityCheckOutputInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ public EntityNameAvailabilityCheckOutputInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java index a706880cdbb3..72845f5eb99f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobImpl.java @@ -4,16 +4,14 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; import com.azure.resourcemanager.mediaservices.models.Job; import com.azure.resourcemanager.mediaservices.models.JobInput; import com.azure.resourcemanager.mediaservices.models.JobOutput; import com.azure.resourcemanager.mediaservices.models.JobState; import com.azure.resourcemanager.mediaservices.models.Priority; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -22,7 +20,7 @@ public final class JobImpl implements Job, Job.Definition, Job.Update { private JobInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -94,7 +92,7 @@ public JobInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -134,7 +132,7 @@ public Job create(Context context) { return this; } - JobImpl(String name, MediaservicesManager serviceManager) { + JobImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new JobInner(); this.serviceManager = serviceManager; this.jobName = name; @@ -165,7 +163,7 @@ public Job apply(Context context) { return this; } - JobImpl(JobInner innerObject, MediaservicesManager serviceManager) { + JobImpl(JobInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -194,16 +192,6 @@ public Job refresh(Context context) { return this; } - public void cancelJob() { - serviceManager.jobs().cancelJob(resourceGroupName, accountName, transformName, jobName); - } - - public Response cancelJobWithResponse(Context context) { - return serviceManager - .jobs() - .cancelJobWithResponse(resourceGroupName, accountName, transformName, jobName, context); - } - public JobImpl withDescription(String description) { this.innerModel().withDescription(description); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java index c27c3ce83da4..733501187c2f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsClientImpl.java @@ -217,6 +217,7 @@ private Mono> listSinglePageAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -228,7 +229,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, filter, orderby, accept, @@ -242,7 +243,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -289,6 +290,7 @@ private Mono> listSinglePageAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -298,7 +300,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, filter, orderby, accept, @@ -465,6 +467,7 @@ private Mono> getWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -477,10 +480,10 @@ private Mono> getWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -524,6 +527,7 @@ private Mono> getWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -534,7 +538,7 @@ private Mono> getWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -647,6 +651,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -659,11 +664,11 @@ private Mono> createWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -718,6 +723,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -728,7 +734,7 @@ private Mono> createWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -846,6 +852,7 @@ private Mono> deleteWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -858,10 +865,10 @@ private Mono> deleteWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -905,6 +912,7 @@ private Mono> deleteWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -915,7 +923,7 @@ private Mono> deleteWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1020,6 +1028,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1032,11 +1041,11 @@ private Mono> updateWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1092,6 +1101,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1102,7 +1112,7 @@ private Mono> updateWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1223,6 +1233,7 @@ private Mono> cancelJobWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1235,10 +1246,10 @@ private Mono> cancelJobWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1282,6 +1293,7 @@ private Mono> cancelJobWithResponseAsync( if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1292,7 +1304,7 @@ private Mono> cancelJobWithResponseAsync( accountName, transformName, jobName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1383,7 +1395,7 @@ private Mono> listNextSinglePageAsync(String nextLink) { res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java index c75cb089fa4f..cdf45eebc40b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/JobsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.JobsClient; import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; import com.azure.resourcemanager.mediaservices.models.Job; @@ -21,9 +20,10 @@ public final class JobsImpl implements Jobs { private final JobsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public JobsImpl(JobsClient innerClient, MediaservicesManager serviceManager) { + public JobsImpl( + JobsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -225,7 +225,7 @@ private JobsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java index 3420e0c8b7bb..d6b4ef11730e 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListContentKeysResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; import com.azure.resourcemanager.mediaservices.models.ListContentKeysResponse; import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; @@ -14,9 +13,11 @@ public final class ListContentKeysResponseImpl implements ListContentKeysResponse { private ListContentKeysResponseInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - ListContentKeysResponseImpl(ListContentKeysResponseInner innerObject, MediaservicesManager serviceManager) { + ListContentKeysResponseImpl( + ListContentKeysResponseInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -34,7 +35,7 @@ public ListContentKeysResponseInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java index 277407a80b32..832527efd8bd 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListPathsResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; import com.azure.resourcemanager.mediaservices.models.ListPathsResponse; import com.azure.resourcemanager.mediaservices.models.StreamingPath; @@ -14,9 +13,11 @@ public final class ListPathsResponseImpl implements ListPathsResponse { private ListPathsResponseInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - ListPathsResponseImpl(ListPathsResponseInner innerObject, MediaservicesManager serviceManager) { + ListPathsResponseImpl( + ListPathsResponseInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -43,7 +44,7 @@ public ListPathsResponseInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java index c7ef643cb25d..084664b44f04 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/ListStreamingLocatorsResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.ListStreamingLocatorsResponseInner; import com.azure.resourcemanager.mediaservices.models.AssetStreamingLocator; import com.azure.resourcemanager.mediaservices.models.ListStreamingLocatorsResponse; @@ -14,10 +13,11 @@ public final class ListStreamingLocatorsResponseImpl implements ListStreamingLocatorsResponse { private ListStreamingLocatorsResponseInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; ListStreamingLocatorsResponseImpl( - ListStreamingLocatorsResponseInner innerObject, MediaservicesManager serviceManager) { + ListStreamingLocatorsResponseInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ public ListStreamingLocatorsResponseInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java index 8ddc2adf9fd0..8af8f0038b59 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventImpl.java @@ -5,19 +5,17 @@ package com.azure.resourcemanager.mediaservices.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; import com.azure.resourcemanager.mediaservices.models.LiveEvent; -import com.azure.resourcemanager.mediaservices.models.LiveEventActionInput; import com.azure.resourcemanager.mediaservices.models.LiveEventEncoding; import com.azure.resourcemanager.mediaservices.models.LiveEventInput; import com.azure.resourcemanager.mediaservices.models.LiveEventPreview; import com.azure.resourcemanager.mediaservices.models.LiveEventResourceState; import com.azure.resourcemanager.mediaservices.models.LiveEventTranscription; import com.azure.resourcemanager.mediaservices.models.StreamOptionsFlag; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -26,7 +24,7 @@ public final class LiveEventImpl implements LiveEvent, LiveEvent.Definition, LiveEvent.Update { private LiveEventInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -131,7 +129,7 @@ public LiveEventInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -168,7 +166,7 @@ public LiveEvent create(Context context) { return this; } - LiveEventImpl(String name, MediaservicesManager serviceManager) { + LiveEventImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new LiveEventInner(); this.serviceManager = serviceManager; this.liveEventName = name; @@ -197,7 +195,8 @@ public LiveEvent apply(Context context) { return this; } - LiveEventImpl(LiveEventInner innerObject, MediaservicesManager serviceManager) { + LiveEventImpl( + LiveEventInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -225,38 +224,6 @@ public LiveEvent refresh(Context context) { return this; } - public void allocate() { - serviceManager.liveEvents().allocate(resourceGroupName, accountName, liveEventName); - } - - public void allocate(Context context) { - serviceManager.liveEvents().allocate(resourceGroupName, accountName, liveEventName, context); - } - - public void start() { - serviceManager.liveEvents().start(resourceGroupName, accountName, liveEventName); - } - - public void start(Context context) { - serviceManager.liveEvents().start(resourceGroupName, accountName, liveEventName, context); - } - - public void stop(LiveEventActionInput parameters) { - serviceManager.liveEvents().stop(resourceGroupName, accountName, liveEventName, parameters); - } - - public void stop(LiveEventActionInput parameters, Context context) { - serviceManager.liveEvents().stop(resourceGroupName, accountName, liveEventName, parameters, context); - } - - public void reset() { - serviceManager.liveEvents().reset(resourceGroupName, accountName, liveEventName); - } - - public void reset(Context context) { - serviceManager.liveEvents().reset(resourceGroupName, accountName, liveEventName, context); - } - public LiveEventImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java index f611693c0898..0b4a2a3ce044 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsClientImpl.java @@ -259,6 +259,7 @@ private Mono> listSinglePageAsync(String resourceG if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -269,7 +270,7 @@ private Mono> listSinglePageAsync(String resourceG this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -281,7 +282,7 @@ private Mono> listSinglePageAsync(String resourceG res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -317,6 +318,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -325,7 +327,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -440,6 +442,7 @@ private Mono> getWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -451,10 +454,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -494,6 +497,7 @@ private Mono> getWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -503,7 +507,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -613,6 +617,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -624,12 +629,12 @@ private Mono>> createWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, autoStart, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -681,6 +686,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -690,7 +696,7 @@ private Mono>> createWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, autoStart, parameters, accept, @@ -987,6 +993,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -998,11 +1005,11 @@ private Mono>> updateWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1052,6 +1059,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1061,7 +1069,7 @@ private Mono>> updateWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1282,6 +1290,7 @@ private Mono>> deleteWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1293,10 +1302,10 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1336,6 +1345,7 @@ private Mono>> deleteWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1345,7 +1355,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1533,6 +1543,7 @@ private Mono>> allocateWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1544,10 +1555,10 @@ private Mono>> allocateWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1587,6 +1598,7 @@ private Mono>> allocateWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1596,7 +1608,7 @@ private Mono>> allocateWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1785,6 +1797,7 @@ private Mono>> startWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1796,10 +1809,10 @@ private Mono>> startWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1839,6 +1852,7 @@ private Mono>> startWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1848,7 +1862,7 @@ private Mono>> startWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -2041,6 +2055,7 @@ private Mono>> stopWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2052,11 +2067,11 @@ private Mono>> stopWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2106,6 +2121,7 @@ private Mono>> stopWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2115,7 +2131,7 @@ private Mono>> stopWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -2334,6 +2350,7 @@ private Mono>> resetWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2345,10 +2362,10 @@ private Mono>> resetWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2390,6 +2407,7 @@ private Mono>> resetWithResponseAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2399,7 +2417,7 @@ private Mono>> resetWithResponseAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -2598,7 +2616,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java index 2417b37835d1..23e165a67cec 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveEventsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.LiveEventsClient; import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; import com.azure.resourcemanager.mediaservices.models.LiveEvent; @@ -22,9 +21,10 @@ public final class LiveEventsImpl implements LiveEvents { private final LiveEventsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public LiveEventsImpl(LiveEventsClient innerClient, MediaservicesManager serviceManager) { + public LiveEventsImpl( + LiveEventsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -217,7 +217,7 @@ private LiveEventsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java index 92ed2fba4f48..14263b8bba43 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mediaservices.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; import com.azure.resourcemanager.mediaservices.models.Hls; import com.azure.resourcemanager.mediaservices.models.LiveOutput; @@ -16,9 +15,10 @@ public final class LiveOutputImpl implements LiveOutput, LiveOutput.Definition { private LiveOutputInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - LiveOutputImpl(LiveOutputInner innerObject, MediaservicesManager serviceManager) { + LiveOutputImpl( + LiveOutputInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -79,7 +79,7 @@ public LiveOutputInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -116,7 +116,7 @@ public LiveOutput create(Context context) { return this; } - LiveOutputImpl(String name, MediaservicesManager serviceManager) { + LiveOutputImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new LiveOutputInner(); this.serviceManager = serviceManager; this.liveOutputName = name; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java index 0c24ea1c2c8b..55a6960be7a3 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsClientImpl.java @@ -182,6 +182,7 @@ private Mono> listSinglePageAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -193,7 +194,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -205,7 +206,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -245,6 +246,7 @@ private Mono> listSinglePageAsync( if (liveEventName == null) { return Mono.error(new IllegalArgumentException("Parameter liveEventName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -254,7 +256,7 @@ private Mono> listSinglePageAsync( resourceGroupName, accountName, liveEventName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -380,6 +382,7 @@ private Mono> getWithResponseAsync( if (liveOutputName == null) { return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -392,10 +395,10 @@ private Mono> getWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -439,6 +442,7 @@ private Mono> getWithResponseAsync( if (liveOutputName == null) { return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -449,7 +453,7 @@ private Mono> getWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -567,6 +571,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -579,11 +584,11 @@ private Mono>> createWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -638,6 +643,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -648,7 +654,7 @@ private Mono>> createWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -903,6 +909,7 @@ private Mono>> deleteWithResponseAsync( if (liveOutputName == null) { return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -915,10 +922,10 @@ private Mono>> deleteWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -962,6 +969,7 @@ private Mono>> deleteWithResponseAsync( if (liveOutputName == null) { return Mono.error(new IllegalArgumentException("Parameter liveOutputName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -972,7 +980,7 @@ private Mono>> deleteWithResponseAsync( accountName, liveEventName, liveOutputName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1167,7 +1175,7 @@ private Mono> listNextSinglePageAsync(String next res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java index 6c8883a4b700..55083ed45519 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LiveOutputsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.LiveOutputsClient; import com.azure.resourcemanager.mediaservices.fluent.models.LiveOutputInner; import com.azure.resourcemanager.mediaservices.models.LiveOutput; @@ -21,9 +20,10 @@ public final class LiveOutputsImpl implements LiveOutputs { private final LiveOutputsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public LiveOutputsImpl(LiveOutputsClient innerClient, MediaservicesManager serviceManager) { + public LiveOutputsImpl( + LiveOutputsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -213,7 +213,7 @@ private LiveOutputsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java index 0229b4b57365..6c9f0aafb37e 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsClientImpl.java @@ -104,6 +104,7 @@ private Mono> checkNameAvailabi } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -113,11 +114,11 @@ private Mono> checkNameAvailabi this.client.getEndpoint(), this.client.getSubscriptionId(), locationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -154,6 +155,7 @@ private Mono> checkNameAvailabi } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -161,7 +163,7 @@ private Mono> checkNameAvailabi this.client.getEndpoint(), this.client.getSubscriptionId(), locationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java index eb3fa3ca4147..52474fb24fe0 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/LocationsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.LocationsClient; import com.azure.resourcemanager.mediaservices.fluent.models.EntityNameAvailabilityCheckOutputInner; import com.azure.resourcemanager.mediaservices.models.CheckNameAvailabilityInput; @@ -21,9 +20,10 @@ public final class LocationsImpl implements Locations { private final LocationsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public LocationsImpl(LocationsClient innerClient, MediaservicesManager serviceManager) { + public LocationsImpl( + LocationsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -58,7 +58,7 @@ private LocationsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java index 6d6c3b8b0f61..1d6495eef494 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaServiceImpl.java @@ -4,20 +4,17 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; import com.azure.resourcemanager.mediaservices.models.AccountEncryption; -import com.azure.resourcemanager.mediaservices.models.EdgePolicies; -import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; +import com.azure.resourcemanager.mediaservices.models.KeyDelivery; import com.azure.resourcemanager.mediaservices.models.MediaService; import com.azure.resourcemanager.mediaservices.models.MediaServiceIdentity; +import com.azure.resourcemanager.mediaservices.models.MediaServiceUpdate; import com.azure.resourcemanager.mediaservices.models.StorageAccount; import com.azure.resourcemanager.mediaservices.models.StorageAuthentication; -import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.util.Collections; import java.util.List; import java.util.Map; @@ -26,7 +23,7 @@ public final class MediaServiceImpl implements MediaService, MediaService.Definition, MediaService.Update { private MediaServiceInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -82,6 +79,10 @@ public AccountEncryption encryption() { return this.innerModel().encryption(); } + public KeyDelivery keyDelivery() { + return this.innerModel().keyDelivery(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -94,7 +95,7 @@ public MediaServiceInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -102,6 +103,8 @@ private MediaservicesManager manager() { private String accountName; + private MediaServiceUpdate updateParameters; + public MediaServiceImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; @@ -127,13 +130,14 @@ public MediaService create(Context context) { return this; } - MediaServiceImpl(String name, MediaservicesManager serviceManager) { + MediaServiceImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new MediaServiceInner(); this.serviceManager = serviceManager; this.accountName = name; } public MediaServiceImpl update() { + this.updateParameters = new MediaServiceUpdate(); return this; } @@ -142,7 +146,7 @@ public MediaService apply() { serviceManager .serviceClient() .getMediaservices() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .updateWithResponse(resourceGroupName, accountName, updateParameters, Context.NONE) .getValue(); return this; } @@ -152,12 +156,13 @@ public MediaService apply(Context context) { serviceManager .serviceClient() .getMediaservices() - .updateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .updateWithResponse(resourceGroupName, accountName, updateParameters, context) .getValue(); return this; } - MediaServiceImpl(MediaServiceInner innerObject, MediaservicesManager serviceManager) { + MediaServiceImpl( + MediaServiceInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -184,26 +189,6 @@ public MediaService refresh(Context context) { return this; } - public void syncStorageKeys(SyncStorageKeysInput parameters) { - serviceManager.mediaservices().syncStorageKeys(resourceGroupName, accountName, parameters); - } - - public Response syncStorageKeysWithResponse(SyncStorageKeysInput parameters, Context context) { - return serviceManager - .mediaservices() - .syncStorageKeysWithResponse(resourceGroupName, accountName, parameters, context); - } - - public EdgePolicies listEdgePolicies(ListEdgePoliciesInput parameters) { - return serviceManager.mediaservices().listEdgePolicies(resourceGroupName, accountName, parameters); - } - - public Response listEdgePoliciesWithResponse(ListEdgePoliciesInput parameters, Context context) { - return serviceManager - .mediaservices() - .listEdgePoliciesWithResponse(resourceGroupName, accountName, parameters, context); - } - public MediaServiceImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -215,27 +200,66 @@ public MediaServiceImpl withRegion(String location) { } public MediaServiceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } } public MediaServiceImpl withIdentity(MediaServiceIdentity identity) { - this.innerModel().withIdentity(identity); - return this; + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } } public MediaServiceImpl withStorageAccounts(List storageAccounts) { - this.innerModel().withStorageAccounts(storageAccounts); - return this; + if (isInCreateMode()) { + this.innerModel().withStorageAccounts(storageAccounts); + return this; + } else { + this.updateParameters.withStorageAccounts(storageAccounts); + return this; + } } public MediaServiceImpl withStorageAuthentication(StorageAuthentication storageAuthentication) { - this.innerModel().withStorageAuthentication(storageAuthentication); - return this; + if (isInCreateMode()) { + this.innerModel().withStorageAuthentication(storageAuthentication); + return this; + } else { + this.updateParameters.withStorageAuthentication(storageAuthentication); + return this; + } } public MediaServiceImpl withEncryption(AccountEncryption encryption) { - this.innerModel().withEncryption(encryption); - return this; + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public MediaServiceImpl withKeyDelivery(KeyDelivery keyDelivery) { + if (isInCreateMode()) { + this.innerModel().withKeyDelivery(keyDelivery); + return this; + } else { + this.updateParameters.withKeyDelivery(keyDelivery); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java index b36e22d838ac..0b93f8b1d7a8 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesClientImpl.java @@ -36,6 +36,7 @@ import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; import com.azure.resourcemanager.mediaservices.models.ListEdgePoliciesInput; import com.azure.resourcemanager.mediaservices.models.MediaServiceCollection; +import com.azure.resourcemanager.mediaservices.models.MediaServiceUpdate; import com.azure.resourcemanager.mediaservices.models.SyncStorageKeysInput; import reactor.core.publisher.Mono; @@ -139,7 +140,7 @@ Mono> update( @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MediaServiceInner parameters, + @BodyParam("application/json") MediaServiceUpdate parameters, @HeaderParam("Accept") String accept, Context context); @@ -186,18 +187,6 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Media/mediaservices/{accountName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBySubscription( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -246,6 +235,7 @@ private Mono> listByResourceGroupSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -255,7 +245,7 @@ private Mono> listByResourceGroupSinglePageAsyn this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -267,7 +257,7 @@ private Mono> listByResourceGroupSinglePageAsyn res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -299,6 +289,7 @@ private Mono> listByResourceGroupSinglePageAsyn return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -306,7 +297,7 @@ private Mono> listByResourceGroupSinglePageAsyn this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -413,6 +404,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -423,10 +415,10 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -462,6 +454,7 @@ private Mono> getByResourceGroupWithResponseAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -470,7 +463,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -568,6 +561,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -578,11 +572,11 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -624,6 +618,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -632,7 +627,7 @@ private Mono> createOrUpdateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -729,6 +724,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -739,10 +735,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -778,6 +774,7 @@ private Mono> deleteWithResponseAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -786,7 +783,7 @@ private Mono> deleteWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -849,7 +846,7 @@ public Response deleteWithResponse(String resourceGroupName, String accoun */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, MediaServiceInner parameters) { + String resourceGroupName, String accountName, MediaServiceUpdate parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -874,6 +871,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -884,11 +882,11 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -905,7 +903,7 @@ private Mono> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( - String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + String resourceGroupName, String accountName, MediaServiceUpdate parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -930,6 +928,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -938,7 +937,7 @@ private Mono> updateWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -957,7 +956,7 @@ private Mono> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( - String resourceGroupName, String accountName, MediaServiceInner parameters) { + String resourceGroupName, String accountName, MediaServiceUpdate parameters) { return updateWithResponseAsync(resourceGroupName, accountName, parameters) .flatMap( (Response res) -> { @@ -981,7 +980,7 @@ private Mono updateAsync( * @return a Media Services account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceInner parameters) { + public MediaServiceInner update(String resourceGroupName, String accountName, MediaServiceUpdate parameters) { return updateAsync(resourceGroupName, accountName, parameters).block(); } @@ -999,7 +998,7 @@ public MediaServiceInner update(String resourceGroupName, String accountName, Me */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( - String resourceGroupName, String accountName, MediaServiceInner parameters, Context context) { + String resourceGroupName, String accountName, MediaServiceUpdate parameters, Context context) { return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); } @@ -1041,6 +1040,7 @@ private Mono> syncStorageKeysWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1051,11 +1051,11 @@ private Mono> syncStorageKeysWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1097,6 +1097,7 @@ private Mono> syncStorageKeysWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1105,7 +1106,7 @@ private Mono> syncStorageKeysWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1200,6 +1201,7 @@ private Mono> listEdgePoliciesWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1210,11 +1212,11 @@ private Mono> listEdgePoliciesWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1256,6 +1258,7 @@ private Mono> listEdgePoliciesWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1264,7 +1267,7 @@ private Mono> listEdgePoliciesWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1351,17 +1354,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1371,7 +1370,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1397,15 +1396,11 @@ private Mono> listSinglePageAsync(Context conte new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -1471,137 +1466,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionWithResponseAsync(String 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getBySubscription( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - accountName, - this.client.getApiVersion(), - accept, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @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 details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBySubscriptionWithResponseAsync(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 (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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getBySubscription( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - accountName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getBySubscriptionAsync(String accountName) { - return getBySubscriptionWithResponseAsync(accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MediaServiceInner getBySubscription(String accountName) { - return getBySubscriptionAsync(accountName).block(); - } - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @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 details of a Media Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBySubscriptionWithResponse(String accountName, Context context) { - return getBySubscriptionWithResponseAsync(accountName, context).block(); - } - /** * Get the next page of items. * @@ -1634,7 +1498,7 @@ private Mono> listNextSinglePageAsync(String ne res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1706,7 +1570,7 @@ private Mono> listBySubscriptionNextSinglePageA res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java index 2c1bea1841b8..9a6f1e00c0ce 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/MediaservicesImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.MediaservicesClient; import com.azure.resourcemanager.mediaservices.fluent.models.EdgePoliciesInner; import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; @@ -25,9 +24,10 @@ public final class MediaservicesImpl implements Mediaservices { private final MediaservicesClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public MediaservicesImpl(MediaservicesClient innerClient, MediaservicesManager serviceManager) { + public MediaservicesImpl( + MediaservicesClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -118,28 +118,6 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new MediaServiceImpl(inner1, this.manager())); } - public MediaService getBySubscription(String accountName) { - MediaServiceInner inner = this.serviceClient().getBySubscription(accountName); - if (inner != null) { - return new MediaServiceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getBySubscriptionWithResponse(String accountName, Context context) { - Response inner = this.serviceClient().getBySubscriptionWithResponse(accountName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new MediaServiceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - public MediaService getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -220,7 +198,7 @@ private MediaservicesClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java index 1ef24d5cb76b..b7a1d9f6fc75 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationImpl.java @@ -4,8 +4,8 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; +import com.azure.resourcemanager.mediaservices.models.ActionType; import com.azure.resourcemanager.mediaservices.models.Operation; import com.azure.resourcemanager.mediaservices.models.OperationDisplay; import com.azure.resourcemanager.mediaservices.models.Properties; @@ -13,9 +13,10 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - OperationImpl(OperationInner innerObject, MediaservicesManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -36,11 +37,19 @@ public Properties properties() { return this.innerModel().properties(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + public OperationInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java index 1ee219337001..4ccae7ab1d58 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsClientImpl.java @@ -95,10 +95,10 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -108,7 +108,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -128,10 +128,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( @@ -228,7 +229,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java index 19cc87712b4e..e4c1719f7bf0 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/OperationsImpl.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.OperationsClient; import com.azure.resourcemanager.mediaservices.fluent.models.OperationInner; import com.azure.resourcemanager.mediaservices.models.Operation; @@ -19,9 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public OperationsImpl(OperationsClient innerClient, MediaservicesManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java index 677f109ff150..41823661c24f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.mediaservices.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.mediaservices.models.PrivateEndpoint; import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnection; @@ -16,7 +15,7 @@ public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { private PrivateEndpointConnectionInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -46,7 +45,7 @@ public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -82,7 +81,8 @@ public PrivateEndpointConnection create(Context context) { return this; } - PrivateEndpointConnectionImpl(String name, MediaservicesManager serviceManager) { + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new PrivateEndpointConnectionInner(); this.serviceManager = serviceManager; this.name = name; @@ -112,7 +112,9 @@ public PrivateEndpointConnection apply(Context context) { return this; } - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, MediaservicesManager serviceManager) { + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java index 846ab8c79610..e733c8ca2eca 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionListResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnection; @@ -16,10 +15,11 @@ public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { private PrivateEndpointConnectionListResultInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; PrivateEndpointConnectionListResultImpl( - PrivateEndpointConnectionListResultInner innerObject, MediaservicesManager serviceManager) { + PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +42,7 @@ public PrivateEndpointConnectionListResultInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java index bee1c3cc9422..521570eea1b5 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsClientImpl.java @@ -157,6 +157,7 @@ private Mono> listWithRespons if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -167,10 +168,10 @@ private Mono> listWithRespons this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -206,6 +207,7 @@ private Mono> listWithRespons if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -214,7 +216,7 @@ private Mono> listWithRespons this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -310,6 +312,7 @@ private Mono> getWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -321,10 +324,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -364,6 +367,7 @@ private Mono> getWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -373,7 +377,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -478,6 +482,7 @@ private Mono> createOrUpdateWithRespons } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -489,11 +494,11 @@ private Mono> createOrUpdateWithRespons resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -543,6 +548,7 @@ private Mono> createOrUpdateWithRespons } else { parameters.validate(); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -552,7 +558,7 @@ private Mono> createOrUpdateWithRespons resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -660,6 +666,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -671,10 +678,10 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -714,6 +721,7 @@ private Mono> deleteWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -723,7 +731,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java index 4dc501f6d270..9f54cbc42d51 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateEndpointConnectionsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateEndpointConnectionListResultInner; @@ -22,10 +21,11 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final PrivateEndpointConnectionsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, MediaservicesManager serviceManager) { + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -207,7 +207,7 @@ private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java index cdd3d14cb8ca..3d3c27639a4d 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.mediaservices.models.PrivateLinkResource; import java.util.Collections; @@ -13,9 +12,11 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private PrivateLinkResourceInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, MediaservicesManager serviceManager) { + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -58,7 +59,7 @@ public PrivateLinkResourceInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java index 2005e9ddbed2..231fe7dd99fe 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourceListResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; import com.azure.resourcemanager.mediaservices.models.PrivateLinkResource; @@ -16,10 +15,11 @@ public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { private PrivateLinkResourceListResultInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; PrivateLinkResourceListResultImpl( - PrivateLinkResourceListResultInner innerObject, MediaservicesManager serviceManager) { + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +42,7 @@ public PrivateLinkResourceListResultInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java index ab45bbd0a212..eed462388c86 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesClientImpl.java @@ -120,6 +120,7 @@ private Mono> listWithResponseAsync if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -130,10 +131,10 @@ private Mono> listWithResponseAsync this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -169,6 +170,7 @@ private Mono> listWithResponseAsync if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -177,7 +179,7 @@ private Mono> listWithResponseAsync this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -273,6 +275,7 @@ private Mono> getWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -284,10 +287,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -327,6 +330,7 @@ private Mono> getWithResponseAsync( if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } + final String apiVersion = "2021-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -336,7 +340,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, name, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java index b04f768a2221..777b8acd2e00 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/PrivateLinkResourcesImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.mediaservices.fluent.models.PrivateLinkResourceListResultInner; @@ -22,9 +21,11 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final PrivateLinkResourcesClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, MediaservicesManager serviceManager) { + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -81,7 +82,7 @@ private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java index 8e3ce40362e3..33b9ca4b0885 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StorageEncryptedAssetDecryptionDataImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner; import com.azure.resourcemanager.mediaservices.models.AssetFileEncryptionMetadata; import com.azure.resourcemanager.mediaservices.models.StorageEncryptedAssetDecryptionData; @@ -14,10 +13,11 @@ public final class StorageEncryptedAssetDecryptionDataImpl implements StorageEncryptedAssetDecryptionData { private StorageEncryptedAssetDecryptionDataInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; StorageEncryptedAssetDecryptionDataImpl( - StorageEncryptedAssetDecryptionDataInner innerObject, MediaservicesManager serviceManager) { + StorageEncryptedAssetDecryptionDataInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public StorageEncryptedAssetDecryptionDataInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java index 4c814722d0e6..5cf356e6667b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointImpl.java @@ -5,15 +5,13 @@ package com.azure.resourcemanager.mediaservices.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies; import com.azure.resourcemanager.mediaservices.models.StreamingEndpoint; import com.azure.resourcemanager.mediaservices.models.StreamingEndpointAccessControl; import com.azure.resourcemanager.mediaservices.models.StreamingEndpointResourceState; -import com.azure.resourcemanager.mediaservices.models.StreamingEntityScaleUnit; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -23,7 +21,7 @@ public final class StreamingEndpointImpl implements StreamingEndpoint, StreamingEndpoint.Definition, StreamingEndpoint.Update { private StreamingEndpointInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -135,7 +133,7 @@ public StreamingEndpointInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -178,7 +176,7 @@ public StreamingEndpoint create(Context context) { return this; } - StreamingEndpointImpl(String name, MediaservicesManager serviceManager) { + StreamingEndpointImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new StreamingEndpointInner(); this.serviceManager = serviceManager; this.streamingEndpointName = name; @@ -207,7 +205,9 @@ public StreamingEndpoint apply(Context context) { return this; } - StreamingEndpointImpl(StreamingEndpointInner innerObject, MediaservicesManager serviceManager) { + StreamingEndpointImpl( + StreamingEndpointInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -235,32 +235,6 @@ public StreamingEndpoint refresh(Context context) { return this; } - public void start() { - serviceManager.streamingEndpoints().start(resourceGroupName, accountName, streamingEndpointName); - } - - public void start(Context context) { - serviceManager.streamingEndpoints().start(resourceGroupName, accountName, streamingEndpointName, context); - } - - public void stop() { - serviceManager.streamingEndpoints().stop(resourceGroupName, accountName, streamingEndpointName); - } - - public void stop(Context context) { - serviceManager.streamingEndpoints().stop(resourceGroupName, accountName, streamingEndpointName, context); - } - - public void scale(StreamingEntityScaleUnit parameters) { - serviceManager.streamingEndpoints().scale(resourceGroupName, accountName, streamingEndpointName, parameters); - } - - public void scale(StreamingEntityScaleUnit parameters, Context context) { - serviceManager - .streamingEndpoints() - .scale(resourceGroupName, accountName, streamingEndpointName, parameters, context); - } - public StreamingEndpointImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java index 13c59c785e3e..7d3ca3b07737 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsClientImpl.java @@ -244,6 +244,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -254,7 +255,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context)) .>map( @@ -266,7 +267,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -302,6 +303,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -310,7 +312,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, accept, context) .map( @@ -426,6 +428,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -437,10 +440,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -481,6 +484,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -490,7 +494,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -602,6 +606,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -613,12 +618,12 @@ private Mono>> createWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, autoStart, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -671,6 +676,7 @@ private Mono>> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -680,7 +686,7 @@ private Mono>> createWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, autoStart, parameters, accept, @@ -989,6 +995,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1000,11 +1007,11 @@ private Mono>> updateWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1055,6 +1062,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1064,7 +1072,7 @@ private Mono>> updateWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1295,6 +1303,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1306,10 +1315,10 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1350,6 +1359,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1359,7 +1369,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1549,6 +1559,7 @@ private Mono>> startWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1560,10 +1571,10 @@ private Mono>> startWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1604,6 +1615,7 @@ private Mono>> startWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1613,7 +1625,7 @@ private Mono>> startWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1803,6 +1815,7 @@ private Mono>> stopWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1814,10 +1827,10 @@ private Mono>> stopWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1858,6 +1871,7 @@ private Mono>> stopWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingEndpointName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1867,7 +1881,7 @@ private Mono>> stopWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -2066,6 +2080,7 @@ private Mono>> scaleWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -2077,11 +2092,11 @@ private Mono>> scaleWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2132,6 +2147,7 @@ private Mono>> scaleWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -2141,7 +2157,7 @@ private Mono>> scaleWithResponseAsync( resourceGroupName, accountName, streamingEndpointName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -2367,7 +2383,7 @@ private Mono> listNextSinglePageAsync(Stri res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java index e5c02081dc40..0ebf940a6298 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingEndpointsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.StreamingEndpointsClient; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; import com.azure.resourcemanager.mediaservices.models.StreamingEndpoint; @@ -22,9 +21,11 @@ public final class StreamingEndpointsImpl implements StreamingEndpoints { private final StreamingEndpointsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public StreamingEndpointsImpl(StreamingEndpointsClient innerClient, MediaservicesManager serviceManager) { + public StreamingEndpointsImpl( + StreamingEndpointsClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -221,7 +222,7 @@ private StreamingEndpointsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java index 14b21610a529..cf66f2b92d9b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorImpl.java @@ -4,15 +4,11 @@ package com.azure.resourcemanager.mediaservices.implementation; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; -import com.azure.resourcemanager.mediaservices.models.ListContentKeysResponse; -import com.azure.resourcemanager.mediaservices.models.ListPathsResponse; import com.azure.resourcemanager.mediaservices.models.StreamingLocator; import com.azure.resourcemanager.mediaservices.models.StreamingLocatorContentKey; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -21,9 +17,11 @@ public final class StreamingLocatorImpl implements StreamingLocator, StreamingLocator.Definition { private StreamingLocatorInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - StreamingLocatorImpl(StreamingLocatorInner innerObject, MediaservicesManager serviceManager) { + StreamingLocatorImpl( + StreamingLocatorInner innerObject, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -98,7 +96,7 @@ public StreamingLocatorInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -135,7 +133,7 @@ public StreamingLocator create(Context context) { return this; } - StreamingLocatorImpl(String name, MediaservicesManager serviceManager) { + StreamingLocatorImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new StreamingLocatorInner(); this.serviceManager = serviceManager; this.streamingLocatorName = name; @@ -161,26 +159,6 @@ public StreamingLocator refresh(Context context) { return this; } - public ListContentKeysResponse listContentKeys() { - return serviceManager.streamingLocators().listContentKeys(resourceGroupName, accountName, streamingLocatorName); - } - - public Response listContentKeysWithResponse(Context context) { - return serviceManager - .streamingLocators() - .listContentKeysWithResponse(resourceGroupName, accountName, streamingLocatorName, context); - } - - public ListPathsResponse listPaths() { - return serviceManager.streamingLocators().listPaths(resourceGroupName, accountName, streamingLocatorName); - } - - public Response listPathsWithResponse(Context context) { - return serviceManager - .streamingLocators() - .listPathsWithResponse(resourceGroupName, accountName, streamingLocatorName, context); - } - public StreamingLocatorImpl withAssetName(String assetName) { this.innerModel().withAssetName(assetName); return this; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java index b82039d9d0ed..2d63c12be19f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsClientImpl.java @@ -211,6 +211,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -221,7 +222,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -236,7 +237,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -276,6 +277,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -284,7 +286,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -442,6 +444,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -453,10 +456,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -497,6 +500,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -506,7 +510,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -613,6 +617,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -624,11 +629,11 @@ private Mono> createWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -679,6 +684,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -688,7 +694,7 @@ private Mono> createWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -799,6 +805,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -810,10 +817,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -854,6 +861,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -863,7 +871,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -955,6 +963,7 @@ private Mono> listContentKeysWithResponse return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -966,10 +975,10 @@ private Mono> listContentKeysWithResponse resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1010,6 +1019,7 @@ private Mono> listContentKeysWithResponse return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1019,7 +1029,7 @@ private Mono> listContentKeysWithResponse resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1121,6 +1131,7 @@ private Mono> listPathsWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1132,10 +1143,10 @@ private Mono> listPathsWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1176,6 +1187,7 @@ private Mono> listPathsWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1185,7 +1197,7 @@ private Mono> listPathsWithResponseAsync( resourceGroupName, accountName, streamingLocatorName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1281,7 +1293,7 @@ private Mono> listNextSinglePageAsync(Strin res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java index c3c16fa15571..04b8843f556f 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingLocatorsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.StreamingLocatorsClient; import com.azure.resourcemanager.mediaservices.fluent.models.ListContentKeysResponseInner; import com.azure.resourcemanager.mediaservices.fluent.models.ListPathsResponseInner; @@ -25,9 +24,11 @@ public final class StreamingLocatorsImpl implements StreamingLocators { private final StreamingLocatorsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public StreamingLocatorsImpl(StreamingLocatorsClient innerClient, MediaservicesManager serviceManager) { + public StreamingLocatorsImpl( + StreamingLocatorsClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -246,7 +247,7 @@ private StreamingLocatorsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java index aa8f94ed89ec..a9faa8afdd6b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesClientImpl.java @@ -176,6 +176,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -186,7 +187,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -201,7 +202,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -241,6 +242,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -249,7 +251,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, top, orderby, @@ -407,6 +409,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -418,10 +421,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -462,6 +465,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -471,7 +475,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -578,6 +582,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -589,11 +594,11 @@ private Mono> createWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -644,6 +649,7 @@ private Mono> createWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -653,7 +659,7 @@ private Mono> createWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -764,6 +770,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -775,10 +782,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -819,6 +826,7 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter streamingPolicyName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -828,7 +836,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, streamingPolicyName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -915,7 +923,7 @@ private Mono> listNextSinglePageAsync(String res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java index 95b8f488457a..d5ff451a74fb 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPoliciesImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.StreamingPoliciesClient; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; import com.azure.resourcemanager.mediaservices.models.StreamingPolicies; @@ -21,9 +20,11 @@ public final class StreamingPoliciesImpl implements StreamingPolicies { private final StreamingPoliciesClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public StreamingPoliciesImpl(StreamingPoliciesClient innerClient, MediaservicesManager serviceManager) { + public StreamingPoliciesImpl( + StreamingPoliciesClient innerClient, + com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -189,7 +190,7 @@ private StreamingPoliciesClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java index 570782b88a46..01300252fa34 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/StreamingPolicyImpl.java @@ -4,23 +4,23 @@ package com.azure.resourcemanager.mediaservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCbcs; import com.azure.resourcemanager.mediaservices.models.CommonEncryptionCenc; import com.azure.resourcemanager.mediaservices.models.EnvelopeEncryption; import com.azure.resourcemanager.mediaservices.models.NoEncryption; import com.azure.resourcemanager.mediaservices.models.StreamingPolicy; -import com.azure.resourcemanager.mediaservices.models.SystemData; import java.time.OffsetDateTime; public final class StreamingPolicyImpl implements StreamingPolicy, StreamingPolicy.Definition { private StreamingPolicyInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - StreamingPolicyImpl(StreamingPolicyInner innerObject, MediaservicesManager serviceManager) { + StreamingPolicyImpl( + StreamingPolicyInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -69,7 +69,7 @@ public StreamingPolicyInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -106,7 +106,7 @@ public StreamingPolicy create(Context context) { return this; } - StreamingPolicyImpl(String name, MediaservicesManager serviceManager) { + StreamingPolicyImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new StreamingPolicyInner(); this.serviceManager = serviceManager; this.streamingPolicyName = name; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java index 2e551ae1746f..74d4cd5866a5 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformImpl.java @@ -4,10 +4,9 @@ package com.azure.resourcemanager.mediaservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; -import com.azure.resourcemanager.mediaservices.models.SystemData; import com.azure.resourcemanager.mediaservices.models.Transform; import com.azure.resourcemanager.mediaservices.models.TransformOutput; import java.time.OffsetDateTime; @@ -17,7 +16,7 @@ public final class TransformImpl implements Transform, Transform.Definition, Transform.Update { private TransformInner innerObject; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; public String id() { return this.innerModel().id(); @@ -60,7 +59,7 @@ public TransformInner innerModel() { return this.innerObject; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } @@ -97,7 +96,7 @@ public Transform create(Context context) { return this; } - TransformImpl(String name, MediaservicesManager serviceManager) { + TransformImpl(String name, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = new TransformInner(); this.serviceManager = serviceManager; this.transformName = name; @@ -127,7 +126,8 @@ public Transform apply(Context context) { return this; } - TransformImpl(TransformInner innerObject, MediaservicesManager serviceManager) { + TransformImpl( + TransformInner innerObject, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java index 89197c265325..e06a648fe2fc 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsClientImpl.java @@ -191,6 +191,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -201,7 +202,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, orderby, accept, @@ -215,7 +216,7 @@ private Mono> listSinglePageAsync( res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -253,6 +254,7 @@ private Mono> listSinglePageAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -261,7 +263,7 @@ private Mono> listSinglePageAsync( this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), + apiVersion, filter, orderby, accept, @@ -409,6 +411,7 @@ private Mono> getWithResponseAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -420,10 +423,10 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -463,6 +466,7 @@ private Mono> getWithResponseAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -472,7 +476,7 @@ private Mono> getWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -578,6 +582,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -589,11 +594,11 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -644,6 +649,7 @@ private Mono> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -653,7 +659,7 @@ private Mono> createOrUpdateWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -766,6 +772,7 @@ private Mono> deleteWithResponseAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -777,10 +784,10 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -820,6 +827,7 @@ private Mono> deleteWithResponseAsync( if (transformName == null) { return Mono.error(new IllegalArgumentException("Parameter transformName is required and cannot be null.")); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -829,7 +837,7 @@ private Mono> deleteWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -927,6 +935,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -938,11 +947,11 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -993,6 +1002,7 @@ private Mono> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1002,7 +1012,7 @@ private Mono> updateWithResponseAsync( resourceGroupName, accountName, transformName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1110,7 +1120,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().odataNextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java index 5453b9d921ff..1f35bcf6877a 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/TransformsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.mediaservices.MediaservicesManager; import com.azure.resourcemanager.mediaservices.fluent.TransformsClient; import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; import com.azure.resourcemanager.mediaservices.models.Transform; @@ -21,9 +20,10 @@ public final class TransformsImpl implements Transforms { private final TransformsClient innerClient; - private final MediaservicesManager serviceManager; + private final com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager; - public TransformsImpl(TransformsClient innerClient, MediaservicesManager serviceManager) { + public TransformsImpl( + TransformsClient innerClient, com.azure.resourcemanager.mediaservices.MediaServicesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -181,7 +181,7 @@ private TransformsClient serviceClient() { return this.innerClient; } - private MediaservicesManager manager() { + private com.azure.resourcemanager.mediaservices.MediaServicesManager manager() { return this.serviceManager; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java index bde58f2c6bbd..0fcbd7349983 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/Utils.java @@ -17,7 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -79,76 +79,84 @@ static PagedIterable mapPage(PagedIterable pageIterable, Function extends PagedIterable { - private final PagedIterable pageIterable; + private final PagedIterable pagedIterable; private final Function mapper; private final Function, PagedResponse> pageMapper; - private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { - super(new PagedFlux(Mono::empty)); - this.pageIterable = pageIterable; + 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 = - page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + 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 pageIterable.stream().map(mapper); + return pagedIterable.stream().map(mapper); } @Override public Stream> streamByPage() { - return pageIterable.streamByPage().map(pageMapper); + return pagedIterable.streamByPage().map(pageMapper); } @Override public Stream> streamByPage(String continuationToken) { - return pageIterable.streamByPage(continuationToken).map(pageMapper); + return pagedIterable.streamByPage(continuationToken).map(pageMapper); } @Override public Stream> streamByPage(int preferredPageSize) { - return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); } @Override public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); } @Override public Iterator iterator() { - return new IteratorImpl(pageIterable.iterator(), mapper); + return new IteratorImpl(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken), pageMapper); + pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(preferredPageSize), pageMapper); + pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccessControl.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccessControl.java new file mode 100644 index 000000000000..660727e45037 --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccessControl.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.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The AccessControl model. */ +@Fluent +public final class AccessControl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessControl.class); + + /* + * The behavior for IP access control in Key Delivery. + */ + @JsonProperty(value = "defaultAction") + private DefaultAction defaultAction; + + /* + * The IP allow list for access control in Key Delivery. If the default + * action is set to 'Allow', the IP allow list must be empty. + */ + @JsonProperty(value = "ipAllowList") + private List ipAllowList; + + /** + * Get the defaultAction property: The behavior for IP access control in Key Delivery. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The behavior for IP access control in Key Delivery. + * + * @param defaultAction the defaultAction value to set. + * @return the AccessControl object itself. + */ + public AccessControl withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the ipAllowList property: The IP allow list for access control in Key Delivery. If the default action is set + * to 'Allow', the IP allow list must be empty. + * + * @return the ipAllowList value. + */ + public List ipAllowList() { + return this.ipAllowList; + } + + /** + * Set the ipAllowList property: The IP allow list for access control in Key Delivery. If the default action is set + * to 'Allow', the IP allow list must be empty. + * + * @param ipAllowList the ipAllowList value to set. + * @return the AccessControl object itself. + */ + public AccessControl withIpAllowList(List ipAllowList) { + this.ipAllowList = ipAllowList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java index 3729605245f4..33eb473d9e62 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AccountFilter.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.AccountFilterInner; import java.util.List; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ActionType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ActionType.java new file mode 100644 index 000000000000..8c8b65a30b3c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ActionType.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.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java index d47ec5f63595..de3addbb7264 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Asset.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.AssetInner; import java.time.OffsetDateTime; @@ -273,69 +273,4 @@ interface WithStorageAccountName { * @return the refreshed resource. */ Asset refresh(Context context); - - /** - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The - * signatures are derived from the storage account keys. - * - * @param parameters The request parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Asset Storage container SAS URLs. - */ - AssetContainerSas listContainerSas(ListContainerSasInput parameters); - - /** - * Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The - * signatures are derived from the storage account keys. - * - * @param parameters The request parameters. - * @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 Asset Storage container SAS URLs. - */ - Response listContainerSasWithResponse(ListContainerSasInput parameters, Context context); - - /** - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - */ - StorageEncryptedAssetDecryptionData getEncryptionKey(); - - /** - * Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - * - * @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 Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API. - */ - Response getEncryptionKeyWithResponse(Context context); - - /** - * Lists Streaming Locators which are associated with this asset. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Streaming Locators associated with this Asset. - */ - ListStreamingLocatorsResponse listStreamingLocators(); - - /** - * Lists Streaming Locators which are associated with this asset. - * - * @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 Streaming Locators associated with this Asset. - */ - Response listStreamingLocatorsWithResponse(Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java index 37dd9574bfb8..8dba573b9484 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/AssetFilter.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.AssetFilterInner; import java.util.List; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java index 6beb89d6a3d5..9e4455fa5f3b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ContentKeyPolicy.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.ContentKeyPolicyInner; import java.time.OffsetDateTime; @@ -205,24 +205,4 @@ interface WithOptions { * @return the refreshed resource. */ ContentKeyPolicy refresh(Context context); - - /** - * Get a Content Key Policy including secret values. - * - * @throws com.azure.core.management.exception.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 Content Key Policy including secret values. - */ - ContentKeyPolicyProperties getPolicyPropertiesWithSecrets(); - - /** - * Get a Content Key Policy including secret values. - * - * @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 Content Key Policy including secret values. - */ - Response getPolicyPropertiesWithSecretsWithResponse(Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CreatedByType.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CreatedByType.java deleted file mode 100644 index 5a01c957d985..000000000000 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/CreatedByType.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mediaservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CreatedByType. */ -public final class CreatedByType extends ExpandableStringEnum { - /** Static value User for CreatedByType. */ - public static final CreatedByType USER = fromString("User"); - - /** Static value Application for CreatedByType. */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for CreatedByType. */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for CreatedByType. */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - @JsonCreator - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** @return known CreatedByType values. */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultAction.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultAction.java new file mode 100644 index 000000000000..5572f3b22dba --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/DefaultAction.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.mediaservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultAction. */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** @return known DefaultAction values. */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java index 738bee03bb41..95284990c07a 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Format.java @@ -22,8 +22,6 @@ @JsonTypeName("Format") @JsonSubTypes({ @JsonSubTypes.Type(name = "#Microsoft.Media.ImageFormat", value = ImageFormat.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class), @JsonSubTypes.Type(name = "#Microsoft.Media.MultiBitrateFormat", value = MultiBitrateFormat.class) }) @JsonFlatten diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java index 2727be117098..0e102ce573ee 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/ImageFormat.java @@ -8,12 +8,21 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** Describes the properties for an output image file. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = ImageFormat.class) @JsonTypeName("#Microsoft.Media.ImageFormat") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "#Microsoft.Media.JpgFormat", value = JpgFormat.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.PngFormat", value = PngFormat.class) +}) @JsonFlatten @Immutable public class ImageFormat extends Format { diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java index 6e5590ff692f..68d646a9db94 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Job.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.JobInner; import java.time.OffsetDateTime; @@ -323,23 +323,4 @@ interface WithCorrelationData { * @return the refreshed resource. */ Job refresh(Context context); - - /** - * Cancel a Job. - * - * @throws com.azure.core.management.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 cancelJob(); - - /** - * Cancel a Job. - * - * @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. - */ - Response cancelJobWithResponse(Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java index 5322419b7203..ea2441bae170 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/JpgFormat.java @@ -16,7 +16,7 @@ @JsonTypeName("#Microsoft.Media.JpgFormat") @JsonFlatten @Immutable -public class JpgFormat extends Format { +public class JpgFormat extends ImageFormat { @JsonIgnore private final ClientLogger logger = new ClientLogger(JpgFormat.class); /** {@inheritDoc} */ diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyDelivery.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyDelivery.java new file mode 100644 index 000000000000..79904f05924c --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/KeyDelivery.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.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyDelivery model. */ +@Fluent +public final class KeyDelivery { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyDelivery.class); + + /* + * The access control properties for Key Delivery. + */ + @JsonProperty(value = "accessControl") + private AccessControl accessControl; + + /** + * Get the accessControl property: The access control properties for Key Delivery. + * + * @return the accessControl value. + */ + public AccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the accessControl property: The access control properties for Key Delivery. + * + * @param accessControl the accessControl value to set. + * @return the KeyDelivery object itself. + */ + public KeyDelivery withAccessControl(AccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessControl() != null) { + accessControl().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java index 7a2f5af9fbb9..517faf98fb57 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/LiveEvent.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.mediaservices.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.LiveEventInner; import java.time.OffsetDateTime; @@ -556,83 +557,4 @@ interface WithStreamOptions { * @return the refreshed resource. */ LiveEvent refresh(Context context); - - /** - * A live event is in StandBy state after allocation completes, and is ready to start. - * - * @throws com.azure.core.management.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 allocate(); - - /** - * A live event is in StandBy state after allocation completes, and is ready to start. - * - * @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 allocate(Context context); - - /** - * A live event in Stopped or StandBy state will be in Running state after the start operation completes. - * - * @throws com.azure.core.management.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 start(); - - /** - * A live event in Stopped or StandBy state will be in Running state after the start operation completes. - * - * @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 start(Context context); - - /** - * Stops a running live event. - * - * @param parameters LiveEvent stop parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 stop(LiveEventActionInput parameters); - - /** - * Stops a running live event. - * - * @param parameters LiveEvent stop parameters. - * @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 stop(LiveEventActionInput parameters, Context context); - - /** - * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and - * will be started again. All assets used by the live outputs and streaming locators created on these assets are - * unaffected. - * - * @throws com.azure.core.management.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 reset(); - - /** - * Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and - * will be started again. All assets used by the live outputs and streaming locators created on these assets are - * unaffected. - * - * @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 reset(Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java index 2e6f5119b0ef..bbe0ddd8decd 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaService.java @@ -4,8 +4,8 @@ package com.azure.resourcemanager.mediaservices.models; -import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.MediaServiceInner; import java.util.List; @@ -91,6 +91,13 @@ public interface MediaService { */ AccountEncryption encryption(); + /** + * Gets the keyDelivery property: The Key Delivery properties for Media Services account. + * + * @return the keyDelivery value. + */ + KeyDelivery keyDelivery(); + /** * Gets the region of the resource. * @@ -161,7 +168,8 @@ interface WithCreate DefinitionStages.WithIdentity, DefinitionStages.WithStorageAccounts, DefinitionStages.WithStorageAuthentication, - DefinitionStages.WithEncryption { + DefinitionStages.WithEncryption, + DefinitionStages.WithKeyDelivery { /** * Executes the create request. * @@ -227,6 +235,16 @@ interface WithEncryption { */ WithCreate withEncryption(AccountEncryption encryption); } + /** The stage of the MediaService definition allowing to specify keyDelivery. */ + interface WithKeyDelivery { + /** + * Specifies the keyDelivery property: The Key Delivery properties for Media Services account.. + * + * @param keyDelivery The Key Delivery properties for Media Services account. + * @return the next definition stage. + */ + WithCreate withKeyDelivery(KeyDelivery keyDelivery); + } } /** * Begins update for the MediaService resource. @@ -241,7 +259,8 @@ interface Update UpdateStages.WithIdentity, UpdateStages.WithStorageAccounts, UpdateStages.WithStorageAuthentication, - UpdateStages.WithEncryption { + UpdateStages.WithEncryption, + UpdateStages.WithKeyDelivery { /** * Executes the update request. * @@ -309,6 +328,16 @@ interface WithEncryption { */ Update withEncryption(AccountEncryption encryption); } + /** The stage of the MediaService update allowing to specify keyDelivery. */ + interface WithKeyDelivery { + /** + * Specifies the keyDelivery property: The Key Delivery properties for Media Services account.. + * + * @param keyDelivery The Key Delivery properties for Media Services account. + * @return the next definition stage. + */ + Update withKeyDelivery(KeyDelivery keyDelivery); + } } /** * Refreshes the resource to sync with Azure. @@ -324,49 +353,4 @@ interface WithEncryption { * @return the refreshed resource. */ MediaService refresh(Context context); - - /** - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param parameters The request parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 syncStorageKeys(SyncStorageKeysInput parameters); - - /** - * Synchronizes storage account keys for a storage account associated with the Media Service account. - * - * @param parameters The request parameters. - * @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. - */ - Response syncStorageKeysWithResponse(SyncStorageKeysInput parameters, Context context); - - /** - * List the media edge policies associated with the Media Services account. - * - * @param parameters The request parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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. - */ - EdgePolicies listEdgePolicies(ListEdgePoliciesInput parameters); - - /** - * List the media edge policies associated with the Media Services account. - * - * @param parameters The request parameters. - * @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. - */ - Response listEdgePoliciesWithResponse(ListEdgePoliciesInput parameters, Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceUpdate.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceUpdate.java new file mode 100644 index 000000000000..a90b0eb769cf --- /dev/null +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MediaServiceUpdate.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.mediaservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** A Media Services account update. */ +@JsonFlatten +@Fluent +public class MediaServiceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MediaServiceUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The Managed Identity for the Media Services account. + */ + @JsonProperty(value = "identity") + private MediaServiceIdentity identity; + + /* + * The Media Services account ID. + */ + @JsonProperty(value = "properties.mediaServiceId", access = JsonProperty.Access.WRITE_ONLY) + private UUID mediaServiceId; + + /* + * The storage accounts for this resource. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /* + * The storageAuthentication property. + */ + @JsonProperty(value = "properties.storageAuthentication") + private StorageAuthentication storageAuthentication; + + /* + * The account encryption properties. + */ + @JsonProperty(value = "properties.encryption") + private AccountEncryption encryption; + + /* + * The Key Delivery properties for Media Services account. + */ + @JsonProperty(value = "properties.keyDelivery") + private KeyDelivery keyDelivery; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The Managed Identity for the Media Services account. + * + * @return the identity value. + */ + public MediaServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed Identity for the Media Services account. + * + * @param identity the identity value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withIdentity(MediaServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the mediaServiceId property: The Media Services account ID. + * + * @return the mediaServiceId value. + */ + public UUID mediaServiceId() { + return this.mediaServiceId; + } + + /** + * Get the storageAccounts property: The storage accounts for this resource. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The storage accounts for this resource. + * + * @param storageAccounts the storageAccounts value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withStorageAccounts(List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the storageAuthentication property: The storageAuthentication property. + * + * @return the storageAuthentication value. + */ + public StorageAuthentication storageAuthentication() { + return this.storageAuthentication; + } + + /** + * Set the storageAuthentication property: The storageAuthentication property. + * + * @param storageAuthentication the storageAuthentication value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withStorageAuthentication(StorageAuthentication storageAuthentication) { + this.storageAuthentication = storageAuthentication; + return this; + } + + /** + * Get the encryption property: The account encryption properties. + * + * @return the encryption value. + */ + public AccountEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The account encryption properties. + * + * @param encryption the encryption value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withEncryption(AccountEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the keyDelivery property: The Key Delivery properties for Media Services account. + * + * @return the keyDelivery value. + */ + public KeyDelivery keyDelivery() { + return this.keyDelivery; + } + + /** + * Set the keyDelivery property: The Key Delivery properties for Media Services account. + * + * @param keyDelivery the keyDelivery value to set. + * @return the MediaServiceUpdate object itself. + */ + public MediaServiceUpdate withKeyDelivery(KeyDelivery keyDelivery) { + this.keyDelivery = keyDelivery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (encryption() != null) { + encryption().validate(); + } + if (keyDelivery() != null) { + keyDelivery().validate(); + } + } +} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java index 1eaffe56d12f..f7698928c9b8 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Mediaservices.java @@ -158,29 +158,6 @@ Response listEdgePoliciesWithResponse( */ PagedIterable list(Context context); - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a Media Services account. - */ - MediaService getBySubscription(String accountName); - - /** - * Get the details of a Media Services account. - * - * @param accountName The Media Services account name. - * @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 details of a Media Services account. - */ - Response getBySubscriptionWithResponse(String accountName, Context context); - /** * Get the details of a Media Services account. * diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java index b4868a6a1bdc..bbca5709d35b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/MetricSpecification.java @@ -63,6 +63,30 @@ public final class MetricSpecification { @JsonProperty(value = "dimensions", access = JsonProperty.Access.WRITE_ONLY) private List dimensions; + /* + * Indicates whether regional MDM account is enabled. + */ + @JsonProperty(value = "enableRegionalMdmAccount", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enableRegionalMdmAccount; + + /* + * The source MDM account. + */ + @JsonProperty(value = "sourceMdmAccount", access = JsonProperty.Access.WRITE_ONLY) + private String sourceMdmAccount; + + /* + * The source MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace", access = JsonProperty.Access.WRITE_ONLY) + private String sourceMdmNamespace; + + /* + * The supported time grain types. + */ + @JsonProperty(value = "supportedTimeGrainTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedTimeGrainTypes; + /** * Get the name property: The metric name. * @@ -146,6 +170,42 @@ public List dimensions() { return this.dimensions; } + /** + * Get the enableRegionalMdmAccount property: Indicates whether regional MDM account is enabled. + * + * @return the enableRegionalMdmAccount value. + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Get the sourceMdmAccount property: The source MDM account. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Get the sourceMdmNamespace property: The source MDM namespace. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Get the supportedTimeGrainTypes property: The supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + /** * Validates the instance. * diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java index b20a45c80d71..004125b0ba95 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Operation.java @@ -36,6 +36,20 @@ public interface Operation { */ Properties properties(); + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + ActionType actionType(); + /** * Gets the inner com.azure.resourcemanager.mediaservices.fluent.models.OperationInner object. * diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java index ee2b945d38c8..40815b458540 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngFormat.java @@ -16,7 +16,7 @@ @JsonTypeName("#Microsoft.Media.PngFormat") @JsonFlatten @Immutable -public class PngFormat extends Format { +public class PngFormat extends ImageFormat { @JsonIgnore private final ClientLogger logger = new ClientLogger(PngFormat.class); /** {@inheritDoc} */ diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java index 0f72fe74353c..0ba7948b9c49 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/PngImage.java @@ -26,14 +26,14 @@ public class PngImage extends Image { * A collection of output PNG image layers to be produced by the encoder. */ @JsonProperty(value = "layers") - private List layers; + private List layers; /** * Get the layers property: A collection of output PNG image layers to be produced by the encoder. * * @return the layers value. */ - public List layers() { + public List layers() { return this.layers; } @@ -43,7 +43,7 @@ public List layers() { * @param layers the layers value to set. * @return the PngImage object itself. */ - public PngImage withLayers(List layers) { + public PngImage withLayers(List layers) { this.layers = layers; return this; } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackByAttribute.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackByAttribute.java index 72f677ac2c08..e09ba68edc56 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackByAttribute.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackByAttribute.java @@ -17,7 +17,7 @@ @JsonTypeName("#Microsoft.Media.SelectVideoTrackByAttribute") @JsonFlatten @Fluent -public class SelectVideoTrackByAttribute extends TrackDescriptor { +public class SelectVideoTrackByAttribute extends VideoTrackDescriptor { @JsonIgnore private final ClientLogger logger = new ClientLogger(SelectVideoTrackByAttribute.class); /* diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackById.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackById.java index 7a4f452b42a2..d472e7e4ba6b 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackById.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SelectVideoTrackById.java @@ -17,7 +17,7 @@ @JsonTypeName("#Microsoft.Media.SelectVideoTrackById") @JsonFlatten @Fluent -public class SelectVideoTrackById extends TrackDescriptor { +public class SelectVideoTrackById extends VideoTrackDescriptor { @JsonIgnore private final ClientLogger logger = new ClientLogger(SelectVideoTrackById.class); /* diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java index 68718919b29d..56dc4e7373f7 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingEndpoint.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.mediaservices.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointInner; import java.time.OffsetDateTime; @@ -549,61 +550,4 @@ interface WithCrossSiteAccessPolicies { * @return the refreshed resource. */ StreamingEndpoint refresh(Context context); - - /** - * Starts an existing streaming endpoint. - * - * @throws com.azure.core.management.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 start(); - - /** - * Starts an existing streaming endpoint. - * - * @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 start(Context context); - - /** - * Stops an existing streaming endpoint. - * - * @throws com.azure.core.management.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 stop(); - - /** - * Stops an existing streaming endpoint. - * - * @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 stop(Context context); - - /** - * Scales an existing streaming endpoint. - * - * @param parameters Streaming endpoint scale parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scale(StreamingEntityScaleUnit parameters); - - /** - * Scales an existing streaming endpoint. - * - * @param parameters Streaming endpoint scale parameters. - * @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 scale(StreamingEntityScaleUnit parameters, Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java index 133b76adf553..dd81c2c3aa59 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingLocator.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; -import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingLocatorInner; import java.time.OffsetDateTime; @@ -286,44 +286,4 @@ interface WithFilters { * @return the refreshed resource. */ StreamingLocator refresh(Context context); - - /** - * List Content Keys used by this Streaming Locator. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class of response for listContentKeys action. - */ - ListContentKeysResponse listContentKeys(); - - /** - * List Content Keys used by this Streaming Locator. - * - * @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 class of response for listContentKeys action. - */ - Response listContentKeysWithResponse(Context context); - - /** - * List Paths supported by this Streaming Locator. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return class of response for listPaths action. - */ - ListPathsResponse listPaths(); - - /** - * List Paths supported by this Streaming Locator. - * - * @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 class of response for listPaths action. - */ - Response listPathsWithResponse(Context context); } diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java index d05961788210..5018f93fc7cf 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/StreamingPolicy.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.StreamingPolicyInner; import java.time.OffsetDateTime; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SystemData.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SystemData.java deleted file mode 100644 index 4df4cb9189f4..000000000000 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/SystemData.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.mediaservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Metadata pertaining to creation and last modification of the resource. */ -@Fluent -public final class SystemData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); - - /* - * The identity that created the resource. - */ - @JsonProperty(value = "createdBy") - private String createdBy; - - /* - * The type of identity that created the resource. - */ - @JsonProperty(value = "createdByType") - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - @JsonProperty(value = "createdAt") - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedBy") - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedByType") - private CreatedByType lastModifiedByType; - - /* - * The timestamp of resource last modification (UTC) - */ - @JsonProperty(value = "lastModifiedAt") - private OffsetDateTime lastModifiedAt; - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackDescriptor.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackDescriptor.java index 2ad4a7a93a8c..cc25cc4288bd 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackDescriptor.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/TrackDescriptor.java @@ -24,11 +24,7 @@ @JsonTypeName("TrackDescriptor") @JsonSubTypes({ @JsonSubTypes.Type(name = "#Microsoft.Media.AudioTrackDescriptor", value = AudioTrackDescriptor.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.VideoTrackDescriptor", value = VideoTrackDescriptor.class), - @JsonSubTypes.Type( - name = "#Microsoft.Media.SelectVideoTrackByAttribute", - value = SelectVideoTrackByAttribute.class), - @JsonSubTypes.Type(name = "#Microsoft.Media.SelectVideoTrackById", value = SelectVideoTrackById.class) + @JsonSubTypes.Type(name = "#Microsoft.Media.VideoTrackDescriptor", value = VideoTrackDescriptor.class) }) @JsonFlatten @Immutable diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java index b15d59006190..8d9872b90009 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/Transform.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.mediaservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.mediaservices.fluent.models.TransformInner; import java.time.OffsetDateTime; diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoTrackDescriptor.java b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoTrackDescriptor.java index 99caa6d1ebc4..7703b9f462dd 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoTrackDescriptor.java +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/models/VideoTrackDescriptor.java @@ -8,12 +8,23 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** A TrackSelection to select video tracks. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@odata\\.type") +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "@odata\\.type", + defaultImpl = VideoTrackDescriptor.class) @JsonTypeName("#Microsoft.Media.VideoTrackDescriptor") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "#Microsoft.Media.SelectVideoTrackByAttribute", + value = SelectVideoTrackByAttribute.class), + @JsonSubTypes.Type(name = "#Microsoft.Media.SelectVideoTrackById", value = SelectVideoTrackById.class) +}) @JsonFlatten @Immutable public class VideoTrackDescriptor extends TrackDescriptor {