diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs index d4b58906a31a6..4b6369ecb64c8 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/AzureMediaServicesClient.cs @@ -86,6 +86,16 @@ public partial class AzureMediaServicesClient : ServiceClient public virtual IMediaservicesOperations Mediaservices { get; private set; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + /// /// Gets the ILocationsOperations. /// @@ -385,6 +395,8 @@ private void Initialize() AccountFilters = new AccountFiltersOperations(this); Operations = new Operations(this); Mediaservices = new MediaservicesOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); Locations = new LocationsOperations(this); Assets = new AssetsOperations(this); AssetFilters = new AssetFiltersOperations(this); @@ -397,7 +409,7 @@ private void Initialize() LiveOutputs = new LiveOutputsOperations(this); StreamingEndpoints = new StreamingEndpointsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-07-01"; + ApiVersion = "2020-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs index 94dd4c27835b4..7a3ab83eee499 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IAzureMediaServicesClient.cs @@ -83,6 +83,16 @@ public partial interface IAzureMediaServicesClient : System.IDisposable /// IMediaservicesOperations Mediaservices { get; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + /// /// Gets the ILocationsOperations. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs index 9668cc95d6b72..0732121fcb99e 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IMediaservicesOperations.cs @@ -246,7 +246,7 @@ public partial interface IMediaservicesOperations /// /// Thrown when a required parameter is null /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a Media Services account /// @@ -271,7 +271,7 @@ public partial interface IMediaservicesOperations /// /// Thrown when a required parameter is null /// - Task> GetBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List Media Services accounts /// @@ -321,6 +321,6 @@ public partial interface IMediaservicesOperations /// /// Thrown when a required parameter is null /// - Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..d603da1f27c6a --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,145 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// Get all private endpoint connections. + /// + /// + /// Get all private endpoint connections. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get private endpoint connection. + /// + /// + /// Get private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update private endpoint connection. + /// + /// + /// Update private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The request parameters + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete private endpoint connection. + /// + /// + /// Delete private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..755c6339fcbbe --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Get list of group IDs. + /// + /// + /// Get list of group IDs. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get group ID. + /// + /// + /// Get group ID. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs index 33b4decc8343b..ae77b603e6d60 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperations.cs @@ -483,6 +483,10 @@ internal MediaservicesOperations(AzureMediaServicesClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -784,7 +788,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1461,7 +1465,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1578,7 +1582,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1591,7 +1595,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1640,7 +1644,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBySubscriptionWithHttpMessagesAsync(string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1763,7 +1767,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1776,7 +1780,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1996,7 +2000,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2105,7 +2109,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2118,7 +2122,7 @@ internal MediaservicesOperations(AzureMediaServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs index 6f802a64b40c0..64024fc7b781a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/MediaservicesOperationsExtensions.cs @@ -366,7 +366,7 @@ public static MediaService Update(this IMediaservicesOperations operations, stri /// /// The operations group for this extension method. /// - public static IPage ListBySubscription(this IMediaservicesOperations operations) + public static IPage ListBySubscription(this IMediaservicesOperations operations) { return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); } @@ -383,7 +383,7 @@ public static IPage ListBySubscription(this IMediaserv /// /// The cancellation token. /// - public static async Task> ListBySubscriptionAsync(this IMediaservicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListBySubscriptionAsync(this IMediaservicesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -403,7 +403,7 @@ public static IPage ListBySubscription(this IMediaserv /// /// The Media Services account name. /// - public static SubscriptionMediaService GetBySubscription(this IMediaservicesOperations operations, string accountName) + public static MediaService GetBySubscription(this IMediaservicesOperations operations, string accountName) { return operations.GetBySubscriptionAsync(accountName).GetAwaiter().GetResult(); } @@ -423,7 +423,7 @@ public static SubscriptionMediaService GetBySubscription(this IMediaservicesOper /// /// The cancellation token. /// - public static async Task GetBySubscriptionAsync(this IMediaservicesOperations operations, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetBySubscriptionAsync(this IMediaservicesOperations operations, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetBySubscriptionWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -483,7 +483,7 @@ public static IPage ListNext(this IMediaservicesOperations operati /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListBySubscriptionNext(this IMediaservicesOperations operations, string nextPageLink) + public static IPage ListBySubscriptionNext(this IMediaservicesOperations operations, string nextPageLink) { return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); } @@ -503,7 +503,7 @@ public static IPage ListBySubscriptionNext(this IMedia /// /// The cancellation token. /// - public static async Task> ListBySubscriptionNextAsync(this IMediaservicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListBySubscriptionNextAsync(this IMediaservicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs new file mode 100644 index 0000000000000..2a144a0a0cee6 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryption.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AccountEncryption + { + /// + /// Initializes a new instance of the AccountEncryption class. + /// + public AccountEncryption() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AccountEncryption class. + /// + /// The type of key used to encrypt the Account Key. + /// Possible values include: 'SystemKey', 'CustomerKey' + /// The properties of the key used to + /// encrypt the account. + public AccountEncryption(AccountEncryptionKeyType type, KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + { + Type = type; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of key used to encrypt the Account Key. + /// Possible values include: 'SystemKey', 'CustomerKey' + /// + [JsonProperty(PropertyName = "type")] + public AccountEncryptionKeyType Type { get; set; } + + /// + /// Gets or sets the properties of the key used to encrypt the account. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyType.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyType.cs new file mode 100644 index 0000000000000..c7e5ee630b4b2 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyType.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for AccountEncryptionKeyType. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(AccountEncryptionKeyTypeConverter))] + public struct AccountEncryptionKeyType : System.IEquatable + { + private AccountEncryptionKeyType(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// The Account Key is encrypted with a System Key. + /// + public static readonly AccountEncryptionKeyType SystemKey = "SystemKey"; + + /// + /// The Account Key is encrypted with a Customer Key. + /// + public static readonly AccountEncryptionKeyType CustomerKey = "CustomerKey"; + + + /// + /// Underlying value of enum AccountEncryptionKeyType + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for AccountEncryptionKeyType + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type AccountEncryptionKeyType + /// + public bool Equals(AccountEncryptionKeyType e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to AccountEncryptionKeyType + /// + public static implicit operator AccountEncryptionKeyType(string value) + { + return new AccountEncryptionKeyType(value); + } + + /// + /// Implicit operator to convert AccountEncryptionKeyType to string + /// + public static implicit operator string(AccountEncryptionKeyType e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum AccountEncryptionKeyType + /// + public static bool operator == (AccountEncryptionKeyType e1, AccountEncryptionKeyType e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum AccountEncryptionKeyType + /// + public static bool operator != (AccountEncryptionKeyType e1, AccountEncryptionKeyType e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for AccountEncryptionKeyType + /// + public override bool Equals(object obj) + { + return obj is AccountEncryptionKeyType && Equals((AccountEncryptionKeyType)obj); + } + + /// + /// Returns for hashCode AccountEncryptionKeyType + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyTypeConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyTypeConverter.cs new file mode 100644 index 0000000000000..82f363c8f686c --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountEncryptionKeyTypeConverter.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for AccountEncryptionKeyType. + /// + public sealed class AccountEncryptionKeyTypeConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to AccountEncryptionKeyType + /// by the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(AccountEncryptionKeyType).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to AccountEncryptionKeyType. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (AccountEncryptionKeyType)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for AccountEncryptionKeyType for + /// serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountFilter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountFilter.cs index 1fedde5086e9f..8357d0cdfdba7 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountFilter.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AccountFilter.cs @@ -34,10 +34,12 @@ public AccountFilter() /// /// Initializes a new instance of the AccountFilter class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The presentation time /// range. /// The first quality. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs index 3eb830ba3f133..f13722e16aa2c 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ApiError.cs @@ -29,7 +29,7 @@ public ApiError() /// /// Initializes a new instance of the ApiError class. /// - /// ApiError + /// The error properties. public ApiError(ODataError error = default(ODataError)) { Error = error; @@ -42,11 +42,8 @@ public ApiError() partial void CustomInit(); /// - /// Gets or sets apiError + /// Gets or sets the error properties. /// - /// - /// The error properties. - /// [JsonProperty(PropertyName = "error")] public ODataError Error { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Asset.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Asset.cs index 75ed1edebd4c4..5b7820cc3c19f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Asset.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Asset.cs @@ -32,10 +32,12 @@ public Asset() /// /// Initializes a new instance of the Asset class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The Asset ID. /// The creation date of the Asset. /// The last modified date of the diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetFilter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetFilter.cs index 24ee96b7d0637..af7a3aed280fc 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetFilter.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AssetFilter.cs @@ -34,10 +34,12 @@ public AssetFilter() /// /// Initializes a new instance of the AssetFilter class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The presentation time /// range. /// The first quality. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AzureEntityResource.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 0000000000000..5c2b5280b0cbf --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition for a Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicy.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicy.cs index 86ac419662693..8fb5b07613d06 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicy.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicy.cs @@ -35,10 +35,12 @@ public ContentKeyPolicy() /// Initializes a new instance of the ContentKeyPolicy class. /// /// The Key Policy options. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The legacy Policy ID. /// The creation date of the Policy /// The last modified date of the diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.cs index 0421427613d23..93009d4039509 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Media.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -36,7 +37,7 @@ public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier() /// class. /// /// The content key ID. - public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier(System.Guid keyId) + public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier(System.Guid? keyId) { KeyId = keyId; CustomInit(); @@ -51,17 +52,20 @@ public ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier(System.Gui /// Gets or sets the content key ID. /// [JsonProperty(PropertyName = "keyId")] - public System.Guid KeyId { get; set; } + public System.Guid? KeyId { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - //Nothing to validate + if (KeyId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyId"); + } } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/EncoderNamedPreset.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/EncoderNamedPreset.cs index 901797126a5ec..46bba4128749a 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/EncoderNamedPreset.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/EncoderNamedPreset.cs @@ -30,21 +30,21 @@ private EncoderNamedPreset(string underlyingValue) /// /// Produces an MP4 file where the video is encoded with H.264 codec at /// 2200 kbps and a picture height of 480 pixels, and the stereo audio - /// is encoded with AAC-LC codec at 64 kbps. + /// is encoded with AAC-LC codec at 128 kbps. /// public static readonly EncoderNamedPreset H264SingleBitrateSD = "H264SingleBitrateSD"; /// /// Produces an MP4 file where the video is encoded with H.264 codec at /// 4500 kbps and a picture height of 720 pixels, and the stereo audio - /// is encoded with AAC-LC codec at 64 kbps. + /// is encoded with AAC-LC codec at 128 kbps. /// public static readonly EncoderNamedPreset H264SingleBitrate720p = "H264SingleBitrate720p"; /// /// Produces an MP4 file where the video is encoded with H.264 codec at /// 6750 kbps and a picture height of 1080 pixels, and the stereo audio - /// is encoded with AAC-LC codec at 64 kbps. + /// is encoded with AAC-LC codec at 128 kbps. /// public static readonly EncoderNamedPreset H264SingleBitrate1080p = "H264SingleBitrate1080p"; @@ -91,21 +91,21 @@ private EncoderNamedPreset(string underlyingValue) /// /// Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps /// to 400 kbps, and stereo AAC audio. Resolution starts at 1080p and - /// goes down to 360p. + /// goes down to 180p. /// public static readonly EncoderNamedPreset H264MultipleBitrate1080p = "H264MultipleBitrate1080p"; /// /// Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps /// to 400 kbps, and stereo AAC audio. Resolution starts at 720p and - /// goes down to 360p. + /// goes down to 180p. /// public static readonly EncoderNamedPreset H264MultipleBitrate720p = "H264MultipleBitrate720p"; /// - /// Produces a set of 5 GOP-aligned MP4 files, ranging from 1600kbps to + /// Produces a set of 5 GOP-aligned MP4 files, ranging from 1900kbps to /// 400 kbps, and stereo AAC audio. Resolution starts at 480p and goes - /// down to 360p. + /// down to 240p. /// public static readonly EncoderNamedPreset H264MultipleBitrateSD = "H264MultipleBitrateSD"; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs index 3a07135fa8a1d..b841e52c2b8eb 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/H264Video.cs @@ -34,14 +34,18 @@ public H264Video() /// /// An optional label for the codec. The label can /// be used to control muxing behavior. - /// The distance between two key frames, - /// thereby defining a group of pictures (GOP). The value should be a - /// non-zero integer in the range [1, 30] seconds, specified in ISO - /// 8601 format. The default is 2 seconds (PT2S). + /// The distance between two key frames. + /// The value should be non-zero in the range [0.5, 20] seconds, + /// specified in ISO 8601 format. The default is 2 seconds(PT2S). Note + /// that this setting is ignored if VideoSyncMode.Passthrough is set, + /// where the KeyFrameInterval value will follow the input source + /// setting. /// The resizing mode - how the input video /// will be resized to fit the desired output resolution(s). Default is /// AutoSize. Possible values include: 'None', 'AutoSize', /// 'AutoFit' + /// The Video Sync Mode. Possible values + /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' /// Whether or not the encoder /// should insert key frames at scene changes. If not specified, the /// default is false. This flag should be set to true only when the @@ -52,8 +56,8 @@ public H264Video() /// include: 'Speed', 'Balanced', 'Quality' /// The collection of output H.264 layers to be /// produced by the encoder. - public H264Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), bool? sceneChangeDetection = default(bool?), H264Complexity? complexity = default(H264Complexity?), IList layers = default(IList)) - : base(label, keyFrameInterval, stretchMode) + public H264Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), bool? sceneChangeDetection = default(bool?), H264Complexity? complexity = default(H264Complexity?), IList layers = default(IList)) + : base(label, keyFrameInterval, stretchMode, syncMode) { SceneChangeDetection = sceneChangeDetection; Complexity = complexity; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Image.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Image.cs index 8da5adee05574..88c81ebf482a8 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Image.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Image.cs @@ -40,14 +40,18 @@ public Image() /// from the first few seconds of the video. /// An optional label for the codec. The label can /// be used to control muxing behavior. - /// The distance between two key frames, - /// thereby defining a group of pictures (GOP). The value should be a - /// non-zero integer in the range [1, 30] seconds, specified in ISO - /// 8601 format. The default is 2 seconds (PT2S). + /// The distance between two key frames. + /// The value should be non-zero in the range [0.5, 20] seconds, + /// specified in ISO 8601 format. The default is 2 seconds(PT2S). Note + /// that this setting is ignored if VideoSyncMode.Passthrough is set, + /// where the KeyFrameInterval value will follow the input source + /// setting. /// The resizing mode - how the input video /// will be resized to fit the desired output resolution(s). Default is /// AutoSize. Possible values include: 'None', 'AutoSize', /// 'AutoFit' + /// The Video Sync Mode. Possible values + /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' /// The intervals at which thumbnails are generated. /// The value can be in absolute timestamp (ISO 8601, e.g: PT05S for /// one image every 5 seconds), or a frame count (For example, 30 for @@ -57,8 +61,8 @@ public Image() /// (ISO 8601, e.g: PT5M30S to stop at 5 minutes and 30 seconds), or a /// frame count (For example, 300 to stop at the 300th frame), or a /// relative value (For example, 100%). - public Image(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), string step = default(string), string range = default(string)) - : base(label, keyFrameInterval, stretchMode) + public Image(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), string step = default(string), string range = default(string)) + : base(label, keyFrameInterval, stretchMode, syncMode) { Start = start; Step = step; diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Job.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Job.cs index a34d1f31dfab9..52dc839981b59 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Job.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Job.cs @@ -37,10 +37,12 @@ public Job() /// /// The inputs for the Job. /// The outputs for the Job. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The UTC date and time when the Job was /// created, in 'YYYY-MM-DDThh:mm:ssZ' format. /// The current state of the job. Possible values diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgImage.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgImage.cs index 331bd46739739..6b73027c3375f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgImage.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/JpgImage.cs @@ -41,14 +41,18 @@ public JpgImage() /// from the first few seconds of the video. /// An optional label for the codec. The label can /// be used to control muxing behavior. - /// The distance between two key frames, - /// thereby defining a group of pictures (GOP). The value should be a - /// non-zero integer in the range [1, 30] seconds, specified in ISO - /// 8601 format. The default is 2 seconds (PT2S). + /// The distance between two key frames. + /// The value should be non-zero in the range [0.5, 20] seconds, + /// specified in ISO 8601 format. The default is 2 seconds(PT2S). Note + /// that this setting is ignored if VideoSyncMode.Passthrough is set, + /// where the KeyFrameInterval value will follow the input source + /// setting. /// The resizing mode - how the input video /// will be resized to fit the desired output resolution(s). Default is /// AutoSize. Possible values include: 'None', 'AutoSize', /// 'AutoFit' + /// The Video Sync Mode. Possible values + /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' /// The intervals at which thumbnails are generated. /// The value can be in absolute timestamp (ISO 8601, e.g: PT05S for /// one image every 5 seconds), or a frame count (For example, 30 for @@ -60,8 +64,8 @@ public JpgImage() /// relative value (For example, 100%). /// A collection of output JPEG image layers to be /// produced by the encoder. - public JpgImage(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), string step = default(string), string range = default(string), IList layers = default(IList)) - : base(start, label, keyFrameInterval, stretchMode, step, range) + public JpgImage(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), string step = default(string), string range = default(string), IList layers = default(IList)) + : base(start, label, keyFrameInterval, stretchMode, syncMode, step, range) { Layers = layers; CustomInit(); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/KeyVaultProperties.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 0000000000000..db0ff037e6386 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// The URL of the Key Vault key used to + /// encrypt the account. The key may either be versioned (for example + /// https://vault/keys/mykey/version1) or reference a key without a + /// version (for example https://vault/keys/mykey). + /// The current key used to encrypt + /// the Media Services account, including the key version. + public KeyVaultProperties(string keyIdentifier = default(string), string currentKeyIdentifier = default(string)) + { + KeyIdentifier = keyIdentifier; + CurrentKeyIdentifier = currentKeyIdentifier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the URL of the Key Vault key used to encrypt the + /// account. The key may either be versioned (for example + /// https://vault/keys/mykey/version1) or reference a key without a + /// version (for example https://vault/keys/mykey). + /// + [JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier { get; set; } + + /// + /// Gets the current key used to encrypt the Media Services account, + /// including the key version. + /// + [JsonProperty(PropertyName = "currentKeyIdentifier")] + public string CurrentKeyIdentifier { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEvent.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEvent.cs index 17e62aa57182a..75637b1d6629c 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEvent.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEvent.cs @@ -34,13 +34,16 @@ public LiveEvent() /// /// Initializes a new instance of the LiveEvent class. /// + /// The geo-location where the resource + /// lives /// The Live Event input. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// Resource tags. - /// The Azure Region of the resource. /// The Live Event description. /// The Live Event preview. /// The Live Event encoding. @@ -51,18 +54,19 @@ public LiveEvent() /// 'Stopping', 'Deleting' /// The Live Event access /// policies. - /// Specifies whether to use a vanity url with - /// the Live Event. This value is specified at creation time and - /// cannot be updated. + /// Specifies whether to use a vanity + /// url with the Live Event. This value is specified at creation time + /// and cannot be updated. /// The options to use for the LiveEvent. - /// This value is specified at creation time and cannot be - /// updated. + /// This value is specified at creation time and cannot be updated. The + /// valid values for the array entry values are 'Default' and + /// 'LowLatency'. /// The exact time the Live Event was /// created. /// The exact time the Live Event was last /// modified. - public LiveEvent(LiveEventInput input, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string description = default(string), LiveEventPreview preview = default(LiveEventPreview), LiveEventEncoding encoding = default(LiveEventEncoding), string provisioningState = default(string), LiveEventResourceState? resourceState = default(LiveEventResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), bool? vanityUrl = default(bool?), IList streamOptions = default(IList), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?)) - : base(id, name, type, tags, location) + public LiveEvent(string location, LiveEventInput input, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), LiveEventPreview preview = default(LiveEventPreview), LiveEventEncoding encoding = default(LiveEventEncoding), string provisioningState = default(string), LiveEventResourceState? resourceState = default(LiveEventResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), bool? useStaticHostname = default(bool?), IList streamOptions = default(IList), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?)) + : base(location, id, name, type, tags) { Description = description; Input = input; @@ -71,7 +75,7 @@ public LiveEvent() ProvisioningState = provisioningState; ResourceState = resourceState; CrossSiteAccessPolicies = crossSiteAccessPolicies; - VanityUrl = vanityUrl; + UseStaticHostname = useStaticHostname; StreamOptions = streamOptions; Created = created; LastModified = lastModified; @@ -131,12 +135,13 @@ public LiveEvent() /// Event. This value is specified at creation time and cannot be /// updated. /// - [JsonProperty(PropertyName = "properties.vanityUrl")] - public bool? VanityUrl { get; set; } + [JsonProperty(PropertyName = "properties.useStaticHostname")] + public bool? UseStaticHostname { get; set; } /// /// Gets or sets the options to use for the LiveEvent. This value is - /// specified at creation time and cannot be updated. + /// specified at creation time and cannot be updated. The valid values + /// for the array entry values are 'Default' and 'LowLatency'. /// [JsonProperty(PropertyName = "properties.streamOptions")] public IList StreamOptions { get; set; } @@ -159,8 +164,9 @@ public LiveEvent() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { + base.Validate(); if (Input == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Input"); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs index e851d5b15be6e..ef8565999e36d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventEncoding.cs @@ -29,11 +29,22 @@ public LiveEventEncoding() /// /// Initializes a new instance of the LiveEventEncoding class. /// - /// The encoding type for Live Event. This - /// value is specified at creation time and cannot be updated. Possible + /// The encoding type for Live Event. This + /// value is specified at creation time and cannot be updated. When + /// encodingType is set to None, the service simply passes through the + /// incoming video and audio layer(s) to the output. When encodingType + /// is set to Standard or Premium1080p, a live encoder transcodes the + /// incoming stream into multiple bit rates or layers. See + /// https://go.microsoft.com/fwlink/?linkid=2095101 for more + /// information. The encodingType of Basic is obsolete – if specified, + /// the service will treat this as a Standard Live Event. Possible /// values include: 'None', 'Basic', 'Standard', 'Premium1080p' - /// The encoding preset name. This value is - /// specified at creation time and cannot be updated. + /// The optional encoding preset name, used + /// when encodingType is not None. This value is specified at creation + /// time and cannot be updated. If the encodingType is set to Standard, + /// then the default preset name is ‘Default720p’. Else if the + /// encodingType is set to Premium1080p, the default preset is + /// ‘Default1080p’. public LiveEventEncoding(LiveEventEncodingType? encodingType = default(LiveEventEncodingType?), string presetName = default(string)) { EncodingType = encodingType; @@ -47,16 +58,26 @@ public LiveEventEncoding() partial void CustomInit(); /// - /// Gets or sets the encoding type for Live Event. This value is - /// specified at creation time and cannot be updated. Possible values - /// include: 'None', 'Basic', 'Standard', 'Premium1080p' + /// Gets or sets the encoding type for Live Event. This value is + /// specified at creation time and cannot be updated. When encodingType + /// is set to None, the service simply passes through the incoming + /// video and audio layer(s) to the output. When encodingType is set to + /// Standard or Premium1080p, a live encoder transcodes the incoming + /// stream into multiple bit rates or layers. See + /// https://go.microsoft.com/fwlink/?linkid=2095101 for more + /// information. The encodingType of Basic is obsolete – if specified, + /// the service will treat this as a Standard Live Event. Possible + /// values include: 'None', 'Basic', 'Standard', 'Premium1080p' /// [JsonProperty(PropertyName = "encodingType")] public LiveEventEncodingType? EncodingType { get; set; } /// - /// Gets or sets the encoding preset name. This value is specified at - /// creation time and cannot be updated. + /// Gets or sets the optional encoding preset name, used when + /// encodingType is not None. This value is specified at creation time + /// and cannot be updated. If the encodingType is set to Standard, then + /// the default preset name is ‘Default720p’. Else if the encodingType + /// is set to Premium1080p, the default preset is ‘Default1080p’. /// [JsonProperty(PropertyName = "presetName")] public string PresetName { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventInput.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventInput.cs index a2de02ba8cbfb..628d902cb9942 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventInput.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveEventInput.cs @@ -38,9 +38,10 @@ public LiveEventInput() /// Input. /// ISO 8601 timespan duration /// of the key frame interval duration. - /// A unique identifier for a stream. This - /// can be specified at creation time but cannot be updated. If - /// omitted, the service will generate a unique value. + /// A UUID in string form to uniquely + /// identify the stream. This can be specified at creation time but + /// cannot be updated. If omitted, the service will generate a unique + /// value. /// The input endpoints for the Live /// Event. public LiveEventInput(LiveEventInputProtocol streamingProtocol, LiveEventInputAccessControl accessControl = default(LiveEventInputAccessControl), string keyFrameIntervalDuration = default(string), string accessToken = default(string), IList endpoints = default(IList)) @@ -80,9 +81,9 @@ public LiveEventInput() public string KeyFrameIntervalDuration { get; set; } /// - /// Gets or sets a unique identifier for a stream. This can be - /// specified at creation time but cannot be updated. If omitted, the - /// service will generate a unique value. + /// Gets or sets a UUID in string form to uniquely identify the stream. + /// This can be specified at creation time but cannot be updated. If + /// omitted, the service will generate a unique value. /// [JsonProperty(PropertyName = "accessToken")] public string AccessToken { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs index 89b384817e7d2..31edf963f9565 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LiveOutput.cs @@ -36,10 +36,12 @@ public LiveOutput() /// ISO 8601 timespan duration of the /// archive window length. This is duration that customer want to /// retain the recorded content. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The description of the Live /// Output. /// The manifest file name. If not diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LogSpecification.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LogSpecification.cs new file mode 100644 index 0000000000000..75eead9445f8c --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/LogSpecification.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A diagnostic log emitted by service. + /// + public partial class LogSpecification + { + /// + /// Initializes a new instance of the LogSpecification class. + /// + public LogSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogSpecification class. + /// + /// The diagnostic log category name. + /// The diagnostic log category display + /// name. + /// The time range for requests in each + /// blob. + public LogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string)) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the diagnostic log category name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the diagnostic log category display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets the time range for requests in each blob. + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs new file mode 100644 index 0000000000000..8bf17a4020486 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityType.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for ManagedIdentityType. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(ManagedIdentityTypeConverter))] + public struct ManagedIdentityType : System.IEquatable + { + private ManagedIdentityType(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// A system-assigned managed identity. + /// + public static readonly ManagedIdentityType SystemAssigned = "SystemAssigned"; + + /// + /// No managed identity. + /// + public static readonly ManagedIdentityType None = "None"; + + + /// + /// Underlying value of enum ManagedIdentityType + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for ManagedIdentityType + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type ManagedIdentityType + /// + public bool Equals(ManagedIdentityType e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to ManagedIdentityType + /// + public static implicit operator ManagedIdentityType(string value) + { + return new ManagedIdentityType(value); + } + + /// + /// Implicit operator to convert ManagedIdentityType to string + /// + public static implicit operator string(ManagedIdentityType e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum ManagedIdentityType + /// + public static bool operator == (ManagedIdentityType e1, ManagedIdentityType e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum ManagedIdentityType + /// + public static bool operator != (ManagedIdentityType e1, ManagedIdentityType e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for ManagedIdentityType + /// + public override bool Equals(object obj) + { + return obj is ManagedIdentityType && Equals((ManagedIdentityType)obj); + } + + /// + /// Returns for hashCode ManagedIdentityType + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs new file mode 100644 index 0000000000000..366f0cfd99375 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ManagedIdentityTypeConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for ManagedIdentityType. + /// + public sealed class ManagedIdentityTypeConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to ManagedIdentityType by + /// the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(ManagedIdentityType).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to ManagedIdentityType. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (ManagedIdentityType)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for ManagedIdentityType for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs index f15f0b2e10be4..8371b85533ed4 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaService.cs @@ -34,20 +34,31 @@ public MediaService() /// /// Initializes a new instance of the MediaService class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// Resource tags. - /// The Azure Region of the resource. /// The Media Services account ID. /// The storage accounts for this /// resource. - public MediaService(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList)) - : base(id, name, type, tags, location) + /// Possible values include: + /// 'System', 'ManagedIdentity' + /// The account encryption properties. + /// The Managed Identity for the Media Services + /// account. + public MediaService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList), StorageAuthentication? storageAuthentication = default(StorageAuthentication?), AccountEncryption encryption = default(AccountEncryption), MediaServiceIdentity identity = default(MediaServiceIdentity)) + : base(location, id, name, type, tags) { MediaServiceId = mediaServiceId; StorageAccounts = storageAccounts; + StorageAuthentication = storageAuthentication; + Encryption = encryption; + Identity = identity; CustomInit(); } @@ -68,5 +79,51 @@ public MediaService() [JsonProperty(PropertyName = "properties.storageAccounts")] public IList StorageAccounts { get; set; } + /// + /// Gets or sets possible values include: 'System', 'ManagedIdentity' + /// + [JsonProperty(PropertyName = "properties.storageAuthentication")] + public StorageAuthentication? StorageAuthentication { get; set; } + + /// + /// Gets or sets the account encryption properties. + /// + [JsonProperty(PropertyName = "properties.encryption")] + public AccountEncryption Encryption { get; set; } + + /// + /// Gets or sets the Managed Identity for the Media Services account. + /// + [JsonProperty(PropertyName = "identity")] + public MediaServiceIdentity Identity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (StorageAccounts != null) + { + foreach (var element in StorageAccounts) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Encryption != null) + { + Encryption.Validate(); + } + if (Identity != null) + { + Identity.Validate(); + } + } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs new file mode 100644 index 0000000000000..c193c28b768e5 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MediaServiceIdentity.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class MediaServiceIdentity + { + /// + /// Initializes a new instance of the MediaServiceIdentity class. + /// + public MediaServiceIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MediaServiceIdentity class. + /// + /// The identity type. Possible values include: + /// 'SystemAssigned', 'None' + /// The Principal ID of the identity. + /// The Tenant ID of the identity. + public MediaServiceIdentity(ManagedIdentityType type, string principalId = default(string), string tenantId = default(string)) + { + Type = type; + PrincipalId = principalId; + TenantId = tenantId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ManagedIdentityType Type { get; set; } + + /// + /// Gets the Principal ID of the identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the Tenant ID of the identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Metric.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricSpecification.cs similarity index 75% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Metric.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricSpecification.cs index 54bf56b6e8ed9..a697749e7599f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Metric.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricSpecification.cs @@ -18,18 +18,18 @@ namespace Microsoft.Azure.Management.Media.Models /// /// A metric emitted by service. /// - public partial class Metric + public partial class MetricSpecification { /// - /// Initializes a new instance of the Metric class. + /// Initializes a new instance of the MetricSpecification class. /// - public Metric() + public MetricSpecification() { CustomInit(); } /// - /// Initializes a new instance of the Metric class. + /// Initializes a new instance of the MetricSpecification class. /// /// The metric name. /// The metric display name. @@ -39,14 +39,17 @@ public Metric() /// 'Bytes', 'Count', 'Milliseconds' /// The metric aggregation type. Possible /// values include: 'Average', 'Count', 'Total' + /// Supported aggregation + /// types. /// The metric dimensions. - public Metric(string name = default(string), string displayName = default(string), string displayDescription = default(string), MetricUnit unit = default(MetricUnit), MetricAggregationType aggregationType = default(MetricAggregationType), IList dimensions = default(IList)) + public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), MetricUnit unit = default(MetricUnit), MetricAggregationType aggregationType = default(MetricAggregationType), IList supportedAggregationTypes = default(IList), IList dimensions = default(IList)) { Name = name; DisplayName = displayName; DisplayDescription = displayDescription; Unit = unit; AggregationType = aggregationType; + SupportedAggregationTypes = supportedAggregationTypes; Dimensions = dimensions; CustomInit(); } @@ -88,6 +91,12 @@ public Metric() [JsonProperty(PropertyName = "aggregationType")] public MetricAggregationType AggregationType { get; private set; } + /// + /// Gets or sets supported aggregation types. + /// + [JsonProperty(PropertyName = "supportedAggregationTypes")] + public IList SupportedAggregationTypes { get; set; } + /// /// Gets the metric dimensions. /// diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Operation.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Operation.cs index 7e74e59f6b4d7..b436ed4d9d120 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Operation.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Operation.cs @@ -34,7 +34,7 @@ public Operation() /// The operation display name. /// Origin of the operation. /// Operation properties format. - public Operation(string name, OperationDisplay display = default(OperationDisplay), string origin = default(string), MetricProperties properties = default(MetricProperties)) + public Operation(string name, OperationDisplay display = default(OperationDisplay), string origin = default(string), Properties properties = default(Properties)) { Name = name; Display = display; @@ -70,7 +70,7 @@ public Operation() /// Gets or sets operation properties format. /// [JsonProperty(PropertyName = "properties")] - public MetricProperties Properties { get; set; } + public Properties Properties { get; set; } /// /// Validate the object. diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngImage.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngImage.cs index e439fa8675b17..e2b4d672d13fc 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngImage.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PngImage.cs @@ -41,14 +41,18 @@ public PngImage() /// from the first few seconds of the video. /// An optional label for the codec. The label can /// be used to control muxing behavior. - /// The distance between two key frames, - /// thereby defining a group of pictures (GOP). The value should be a - /// non-zero integer in the range [1, 30] seconds, specified in ISO - /// 8601 format. The default is 2 seconds (PT2S). + /// The distance between two key frames. + /// The value should be non-zero in the range [0.5, 20] seconds, + /// specified in ISO 8601 format. The default is 2 seconds(PT2S). Note + /// that this setting is ignored if VideoSyncMode.Passthrough is set, + /// where the KeyFrameInterval value will follow the input source + /// setting. /// The resizing mode - how the input video /// will be resized to fit the desired output resolution(s). Default is /// AutoSize. Possible values include: 'None', 'AutoSize', /// 'AutoFit' + /// The Video Sync Mode. Possible values + /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' /// The intervals at which thumbnails are generated. /// The value can be in absolute timestamp (ISO 8601, e.g: PT05S for /// one image every 5 seconds), or a frame count (For example, 30 for @@ -60,8 +64,8 @@ public PngImage() /// relative value (For example, 100%). /// A collection of output PNG image layers to be /// produced by the encoder. - public PngImage(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), string step = default(string), string range = default(string), IList layers = default(IList)) - : base(start, label, keyFrameInterval, stretchMode, step, range) + public PngImage(string start, string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?), string step = default(string), string range = default(string), IList layers = default(IList)) + : base(start, label, keyFrameInterval, stretchMode, syncMode, step, range) { Layers = layers; CustomInit(); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpoint.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 0000000000000..e98cb13f085d6 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint resource. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The ARM identifier for Private Endpoint + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ARM identifier for Private Endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 0000000000000..f2f14245f5034 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Private Endpoint Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : Resource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// A collection of + /// information about the state of the connection between service + /// consumer and provider. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// The resource of private end + /// point. + /// The provisioning state of the + /// private endpoint connection resource. Possible values include: + /// 'Succeeded', 'Creating', 'Deleting', 'Failed' + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateEndpointConnectionProvisioningState? provisioningState = default(PrivateEndpointConnectionProvisioningState?)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource of private end point. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets a collection of information about the state of the + /// connection between service consumer and provider. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets the provisioning state of the private endpoint + /// connection resource. Possible values include: 'Succeeded', + /// 'Creating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + } + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionListResult.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionListResult.cs new file mode 100644 index 0000000000000..686edf81c38ce --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// List of private endpoint connection associated with the specified + /// storage account + /// + public partial class PrivateEndpointConnectionListResult + { + /// + /// Initializes a new instance of the + /// PrivateEndpointConnectionListResult class. + /// + public PrivateEndpointConnectionListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PrivateEndpointConnectionListResult class. + /// + /// Array of private endpoint connections + public PrivateEndpointConnectionListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets array of private endpoint connections + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..66e4fe36ce0db --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(PrivateEndpointConnectionProvisioningStateConverter))] + public struct PrivateEndpointConnectionProvisioningState : System.IEquatable + { + private PrivateEndpointConnectionProvisioningState(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + public static readonly PrivateEndpointConnectionProvisioningState Succeeded = "Succeeded"; + + public static readonly PrivateEndpointConnectionProvisioningState Creating = "Creating"; + + public static readonly PrivateEndpointConnectionProvisioningState Deleting = "Deleting"; + + public static readonly PrivateEndpointConnectionProvisioningState Failed = "Failed"; + + + /// + /// Underlying value of enum PrivateEndpointConnectionProvisioningState + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for + /// PrivateEndpointConnectionProvisioningState + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type PrivateEndpointConnectionProvisioningState + /// + public bool Equals(PrivateEndpointConnectionProvisioningState e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to + /// PrivateEndpointConnectionProvisioningState + /// + public static implicit operator PrivateEndpointConnectionProvisioningState(string value) + { + return new PrivateEndpointConnectionProvisioningState(value); + } + + /// + /// Implicit operator to convert + /// PrivateEndpointConnectionProvisioningState to string + /// + public static implicit operator string(PrivateEndpointConnectionProvisioningState e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum + /// PrivateEndpointConnectionProvisioningState + /// + public static bool operator == (PrivateEndpointConnectionProvisioningState e1, PrivateEndpointConnectionProvisioningState e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum + /// PrivateEndpointConnectionProvisioningState + /// + public static bool operator != (PrivateEndpointConnectionProvisioningState e1, PrivateEndpointConnectionProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for + /// PrivateEndpointConnectionProvisioningState + /// + public override bool Equals(object obj) + { + return obj is PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); + } + + /// + /// Returns for hashCode PrivateEndpointConnectionProvisioningState + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningStateConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningStateConverter.cs new file mode 100644 index 0000000000000..314f7f238f27b --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointConnectionProvisioningStateConverter.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for PrivateEndpointConnectionProvisioningState. + /// + public sealed class PrivateEndpointConnectionProvisioningStateConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to + /// PrivateEndpointConnectionProvisioningState by the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(PrivateEndpointConnectionProvisioningState).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to + /// PrivateEndpointConnectionProvisioningState. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (PrivateEndpointConnectionProvisioningState)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for PrivateEndpointConnectionProvisioningState + /// for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..04824400c633d --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(PrivateEndpointServiceConnectionStatusConverter))] + public struct PrivateEndpointServiceConnectionStatus : System.IEquatable + { + private PrivateEndpointServiceConnectionStatus(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + public static readonly PrivateEndpointServiceConnectionStatus Pending = "Pending"; + + public static readonly PrivateEndpointServiceConnectionStatus Approved = "Approved"; + + public static readonly PrivateEndpointServiceConnectionStatus Rejected = "Rejected"; + + + /// + /// Underlying value of enum PrivateEndpointServiceConnectionStatus + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for + /// PrivateEndpointServiceConnectionStatus + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type PrivateEndpointServiceConnectionStatus + /// + public bool Equals(PrivateEndpointServiceConnectionStatus e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to + /// PrivateEndpointServiceConnectionStatus + /// + public static implicit operator PrivateEndpointServiceConnectionStatus(string value) + { + return new PrivateEndpointServiceConnectionStatus(value); + } + + /// + /// Implicit operator to convert PrivateEndpointServiceConnectionStatus + /// to string + /// + public static implicit operator string(PrivateEndpointServiceConnectionStatus e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum + /// PrivateEndpointServiceConnectionStatus + /// + public static bool operator == (PrivateEndpointServiceConnectionStatus e1, PrivateEndpointServiceConnectionStatus e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum + /// PrivateEndpointServiceConnectionStatus + /// + public static bool operator != (PrivateEndpointServiceConnectionStatus e1, PrivateEndpointServiceConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for + /// PrivateEndpointServiceConnectionStatus + /// + public override bool Equals(object obj) + { + return obj is PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); + } + + /// + /// Returns for hashCode PrivateEndpointServiceConnectionStatus + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatusConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatusConverter.cs new file mode 100644 index 0000000000000..733b3cbd43277 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateEndpointServiceConnectionStatusConverter.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for PrivateEndpointServiceConnectionStatus. + /// + public sealed class PrivateEndpointServiceConnectionStatusConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to + /// PrivateEndpointServiceConnectionStatus by the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(PrivateEndpointServiceConnectionStatus).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to + /// PrivateEndpointServiceConnectionStatus. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (PrivateEndpointServiceConnectionStatus)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for PrivateEndpointServiceConnectionStatus for + /// serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResource.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 0000000000000..29a6abef0b782 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A private link resource + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource : Resource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, type) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; private set; } + + /// + /// Gets the private link resource required member names. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; private set; } + + /// + /// Gets or sets the private link resource Private link DNS zone name. + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResourceListResult.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..471538cf8019d --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkResourceListResult.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of private link resources + /// + public partial class PrivateLinkResourceListResult + { + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + public PrivateLinkResourceListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourceListResult + /// class. + /// + /// Array of private link resources + public PrivateLinkResourceListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets array of private link resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..e13cc9edafcc7 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// Indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected' + /// The reason for approval/rejection of the + /// connection. + /// A message indicating if changes on + /// the service provider require any updates on the consumer. + public PrivateLinkServiceConnectionState(PrivateEndpointServiceConnectionStatus? status = default(PrivateEndpointServiceConnectionStatus?), string description = default(string), string actionsRequired = default(string)) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether the connection has been + /// Approved/Rejected/Removed by the owner of the service. Possible + /// values include: 'Pending', 'Approved', 'Rejected' + /// + [JsonProperty(PropertyName = "status")] + public PrivateEndpointServiceConnectionStatus? Status { get; set; } + + /// + /// Gets or sets the reason for approval/rejection of the connection. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a message indicating if changes on the service + /// provider require any updates on the consumer. + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricProperties.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Properties.cs similarity index 78% rename from sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricProperties.cs rename to sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Properties.cs index ff40e67732c7d..f42ac82fd5bd2 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/MetricProperties.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Properties.cs @@ -14,24 +14,24 @@ namespace Microsoft.Azure.Management.Media.Models using System.Linq; /// - /// Metric properties. + /// The service specification property. /// - public partial class MetricProperties + public partial class Properties { /// - /// Initializes a new instance of the MetricProperties class. + /// Initializes a new instance of the Properties class. /// - public MetricProperties() + public Properties() { CustomInit(); } /// - /// Initializes a new instance of the MetricProperties class. + /// Initializes a new instance of the Properties class. /// /// The service /// specifications. - public MetricProperties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) + public Properties(ServiceSpecification serviceSpecification = default(ServiceSpecification)) { ServiceSpecification = serviceSpecification; CustomInit(); diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProxyResource.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProxyResource.cs index b9bdc8847bb9d..fdef04bebc2b1 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProxyResource.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ProxyResource.cs @@ -13,7 +13,8 @@ namespace Microsoft.Azure.Management.Media.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource. + /// The resource model definition for a ARM proxy resource. It will have + /// everything other than required location and tags /// public partial class ProxyResource : Resource { @@ -28,10 +29,12 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Resource.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Resource.cs index 925b77b440f98..2ecc902265b9f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Resource.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Resource.cs @@ -15,9 +15,6 @@ namespace Microsoft.Azure.Management.Media.Models using Newtonsoft.Json; using System.Linq; - /// - /// The core properties of ARM resources. - /// public partial class Resource : IResource { /// @@ -31,10 +28,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; @@ -49,19 +48,22 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource ID for the resource. + /// Gets fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets the name of the resource. + /// Gets the name of the resource /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets the type of the resource. + /// Gets the type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ServiceSpecification.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ServiceSpecification.cs index 38ee748499a67..c3b6ae87bb836 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ServiceSpecification.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/ServiceSpecification.cs @@ -31,10 +31,12 @@ public ServiceSpecification() /// /// Initializes a new instance of the ServiceSpecification class. /// + /// List of log specifications. /// List of metric /// specifications. - public ServiceSpecification(IList metricSpecifications = default(IList)) + public ServiceSpecification(IList logSpecifications = default(IList), IList metricSpecifications = default(IList)) { + LogSpecifications = logSpecifications; MetricSpecifications = metricSpecifications; CustomInit(); } @@ -44,11 +46,17 @@ public ServiceSpecification() /// partial void CustomInit(); + /// + /// Gets list of log specifications. + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; private set; } + /// /// Gets list of metric specifications. /// [JsonProperty(PropertyName = "metricSpecifications")] - public IList MetricSpecifications { get; private set; } + public IList MetricSpecifications { get; private set; } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthentication.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthentication.cs new file mode 100644 index 0000000000000..874c2e4dd57e4 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthentication.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for StorageAuthentication. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(StorageAuthenticationConverter))] + public struct StorageAuthentication : System.IEquatable + { + private StorageAuthentication(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// System authentication. + /// + public static readonly StorageAuthentication System = "System"; + + /// + /// Managed Identity authentication. + /// + public static readonly StorageAuthentication ManagedIdentity = "ManagedIdentity"; + + + /// + /// Underlying value of enum StorageAuthentication + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for StorageAuthentication + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type StorageAuthentication + /// + public bool Equals(StorageAuthentication e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to StorageAuthentication + /// + public static implicit operator StorageAuthentication(string value) + { + return new StorageAuthentication(value); + } + + /// + /// Implicit operator to convert StorageAuthentication to string + /// + public static implicit operator string(StorageAuthentication e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum StorageAuthentication + /// + public static bool operator == (StorageAuthentication e1, StorageAuthentication e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum StorageAuthentication + /// + public static bool operator != (StorageAuthentication e1, StorageAuthentication e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for StorageAuthentication + /// + public override bool Equals(object obj) + { + return obj is StorageAuthentication && Equals((StorageAuthentication)obj); + } + + /// + /// Returns for hashCode StorageAuthentication + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthenticationConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthenticationConverter.cs new file mode 100644 index 0000000000000..d5552960fe4dd --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StorageAuthenticationConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for StorageAuthentication. + /// + public sealed class StorageAuthenticationConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to StorageAuthentication by + /// the converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(StorageAuthentication).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to StorageAuthentication. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (StorageAuthentication)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for StorageAuthentication for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs index 7b7478fb50dd0..1f738c31f8fda 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingEndpoint.cs @@ -34,14 +34,17 @@ public StreamingEndpoint() /// /// Initializes a new instance of the StreamingEndpoint class. /// + /// The geo-location where the resource + /// lives /// The number of scale units. Use the Scale /// operation to adjust this value. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// Resource tags. - /// The Azure Region of the resource. /// The StreamingEndpoint /// description. /// The name of the AvailabilitySet @@ -69,8 +72,8 @@ public StreamingEndpoint() /// created. /// The exact time the StreamingEndpoint was /// last modified. - public StreamingEndpoint(int scaleUnits, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string description = default(string), string availabilitySetName = default(string), StreamingEndpointAccessControl accessControl = default(StreamingEndpointAccessControl), long? maxCacheAge = default(long?), IList customHostNames = default(IList), string hostName = default(string), bool? cdnEnabled = default(bool?), string cdnProvider = default(string), string cdnProfile = default(string), string provisioningState = default(string), StreamingEndpointResourceState? resourceState = default(StreamingEndpointResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), System.DateTime? freeTrialEndTime = default(System.DateTime?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?)) - : base(id, name, type, tags, location) + public StreamingEndpoint(string location, int scaleUnits, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string availabilitySetName = default(string), StreamingEndpointAccessControl accessControl = default(StreamingEndpointAccessControl), long? maxCacheAge = default(long?), IList customHostNames = default(IList), string hostName = default(string), bool? cdnEnabled = default(bool?), string cdnProvider = default(string), string cdnProfile = default(string), string provisioningState = default(string), StreamingEndpointResourceState? resourceState = default(StreamingEndpointResourceState?), CrossSiteAccessPolicies crossSiteAccessPolicies = default(CrossSiteAccessPolicies), System.DateTime? freeTrialEndTime = default(System.DateTime?), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?)) + : base(location, id, name, type, tags) { Description = description; ScaleUnits = scaleUnits; @@ -204,8 +207,9 @@ public StreamingEndpoint() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { + base.Validate(); } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingLocator.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingLocator.cs index 85b68174ef3dd..3cf552b1a19e1 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingLocator.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingLocator.cs @@ -43,10 +43,12 @@ public StreamingLocator() /// 'Predefined_DownloadAndClearStreaming', 'Predefined_ClearKey', /// 'Predefined_MultiDrmCencStreaming' and /// 'Predefined_MultiDrmStreaming' - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The creation time of the Streaming /// Locator. /// The start time of the Streaming diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingPolicy.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingPolicy.cs index f93f1b7db62b8..f19a86e6b57b6 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingPolicy.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/StreamingPolicy.cs @@ -32,10 +32,12 @@ public StreamingPolicy() /// /// Initializes a new instance of the StreamingPolicy class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// Creation time of Streaming Policy /// Default ContentKey used /// by current Streaming Policy diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/SubscriptionMediaService.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/SubscriptionMediaService.cs deleted file mode 100644 index 8cdde5ff017a1..0000000000000 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/SubscriptionMediaService.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Media.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Media Services account. - /// - [Rest.Serialization.JsonTransformation] - public partial class SubscriptionMediaService : TrackedResource - { - /// - /// Initializes a new instance of the SubscriptionMediaService class. - /// - public SubscriptionMediaService() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SubscriptionMediaService class. - /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. - /// Resource tags. - /// The Azure Region of the resource. - /// The Media Services account ID. - /// The storage accounts for this - /// resource. - public SubscriptionMediaService(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), System.Guid mediaServiceId = default(System.Guid), IList storageAccounts = default(IList)) - : base(id, name, type, tags, location) - { - MediaServiceId = mediaServiceId; - StorageAccounts = storageAccounts; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the Media Services account ID. - /// - [JsonProperty(PropertyName = "properties.mediaServiceId")] - public System.Guid MediaServiceId { get; private set; } - - /// - /// Gets or sets the storage accounts for this resource. - /// - [JsonProperty(PropertyName = "properties.storageAccounts")] - public IList StorageAccounts { get; set; } - - } -} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackedResource.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackedResource.cs index fed74ee38ac17..b9632fc43d237 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackedResource.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/TrackedResource.cs @@ -10,13 +10,14 @@ namespace Microsoft.Azure.Management.Media.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// The resource model definition for a ARM tracked resource. + /// The resource model definition for a ARM tracked top level resource /// public partial class TrackedResource : Resource { @@ -31,13 +32,16 @@ public TrackedResource() /// /// Initializes a new instance of the TrackedResource class. /// - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// The geo-location where the resource + /// lives + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// Resource tags. - /// The Azure Region of the resource. - public TrackedResource(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string)) + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) { Tags = tags; @@ -57,10 +61,23 @@ public TrackedResource() public IDictionary Tags { get; set; } /// - /// Gets or sets the Azure Region of the resource. + /// Gets or sets the geo-location where the resource lives /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Transform.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Transform.cs index 119a6691a5aeb..d4491c9b7a4fe 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Transform.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Transform.cs @@ -39,10 +39,12 @@ public Transform() /// /// An array of one or more TransformOutputs that /// the Transform should generate. - /// Fully qualified resource ID for the - /// resource. - /// The name of the resource. - /// The type of the resource. + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. /// The UTC date and time when the Transform was /// created, in 'YYYY-MM-DDThh:mm:ssZ' format. /// An optional verbose description of the diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Video.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Video.cs index 1e0687b9a9306..2458de4e13b4f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Video.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/Video.cs @@ -32,19 +32,24 @@ public Video() /// /// An optional label for the codec. The label can /// be used to control muxing behavior. - /// The distance between two key frames, - /// thereby defining a group of pictures (GOP). The value should be a - /// non-zero integer in the range [1, 30] seconds, specified in ISO - /// 8601 format. The default is 2 seconds (PT2S). + /// The distance between two key frames. + /// The value should be non-zero in the range [0.5, 20] seconds, + /// specified in ISO 8601 format. The default is 2 seconds(PT2S). Note + /// that this setting is ignored if VideoSyncMode.Passthrough is set, + /// where the KeyFrameInterval value will follow the input source + /// setting. /// The resizing mode - how the input video /// will be resized to fit the desired output resolution(s). Default is /// AutoSize. Possible values include: 'None', 'AutoSize', /// 'AutoFit' - public Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?)) + /// The Video Sync Mode. Possible values + /// include: 'Auto', 'Passthrough', 'Cfr', 'Vfr' + public Video(string label = default(string), System.TimeSpan? keyFrameInterval = default(System.TimeSpan?), StretchMode? stretchMode = default(StretchMode?), VideoSyncMode? syncMode = default(VideoSyncMode?)) : base(label) { KeyFrameInterval = keyFrameInterval; StretchMode = stretchMode; + SyncMode = syncMode; CustomInit(); } @@ -54,10 +59,11 @@ public Video() partial void CustomInit(); /// - /// Gets or sets the distance between two key frames, thereby defining - /// a group of pictures (GOP). The value should be a non-zero integer - /// in the range [1, 30] seconds, specified in ISO 8601 format. The - /// default is 2 seconds (PT2S). + /// Gets or sets the distance between two key frames. The value should + /// be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 + /// format. The default is 2 seconds(PT2S). Note that this setting is + /// ignored if VideoSyncMode.Passthrough is set, where the + /// KeyFrameInterval value will follow the input source setting. /// [JsonProperty(PropertyName = "keyFrameInterval")] public System.TimeSpan? KeyFrameInterval { get; set; } @@ -70,5 +76,12 @@ public Video() [JsonProperty(PropertyName = "stretchMode")] public StretchMode? StretchMode { get; set; } + /// + /// Gets or sets the Video Sync Mode. Possible values include: 'Auto', + /// 'Passthrough', 'Cfr', 'Vfr' + /// + [JsonProperty(PropertyName = "syncMode")] + public VideoSyncMode? SyncMode { get; set; } + } } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncMode.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncMode.cs new file mode 100644 index 0000000000000..814f587c7bd60 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncMode.cs @@ -0,0 +1,136 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + /// + /// Defines values for VideoSyncMode. + /// + /// + /// Determine base value for a given allowed value if exists, else return + /// the value itself + /// + [JsonConverter(typeof(VideoSyncModeConverter))] + public struct VideoSyncMode : System.IEquatable + { + private VideoSyncMode(string underlyingValue) + { + UnderlyingValue=underlyingValue; + } + + /// + /// This is the default method. Chooses between Cfr and Vfr depending + /// on muxer capabilities. For output format MP4, the default mode is + /// Cfr. + /// + public static readonly VideoSyncMode Auto = "Auto"; + + /// + /// The presentation timestamps on frames are passed through from the + /// input file to the output file writer. Recommended when the input + /// source has variable frame rate, and are attempting to produce + /// multiple layers for adaptive streaming in the output which have + /// aligned GOP boundaries. Note: if two or more frames in the input + /// have duplicate timestamps, then the output will also have the same + /// behavior + /// + public static readonly VideoSyncMode Passthrough = "Passthrough"; + + /// + /// Input frames will be repeated and/or dropped as needed to achieve + /// exactly the requested constant frame rate. Recommended when the + /// output frame rate is explicitly set at a specified value + /// + public static readonly VideoSyncMode Cfr = "Cfr"; + + /// + /// Similar to the Passthrough mode, but if the input has frames that + /// have duplicate timestamps, then only one frame is passed through to + /// the output, and others are dropped. Recommended when the number of + /// output frames is expected to be equal to the number of input + /// frames. For example, the output is used to calculate a quality + /// metric like PSNR against the input + /// + public static readonly VideoSyncMode Vfr = "Vfr"; + + + /// + /// Underlying value of enum VideoSyncMode + /// + private readonly string UnderlyingValue; + + /// + /// Returns string representation for VideoSyncMode + /// + public override string ToString() + { + return UnderlyingValue == null ? null : UnderlyingValue.ToString(); + } + + /// + /// Compares enums of type VideoSyncMode + /// + public bool Equals(VideoSyncMode e) + { + return UnderlyingValue.Equals(e.UnderlyingValue); + } + + /// + /// Implicit operator to convert string to VideoSyncMode + /// + public static implicit operator VideoSyncMode(string value) + { + return new VideoSyncMode(value); + } + + /// + /// Implicit operator to convert VideoSyncMode to string + /// + public static implicit operator string(VideoSyncMode e) + { + return e.UnderlyingValue; + } + + /// + /// Overriding == operator for enum VideoSyncMode + /// + public static bool operator == (VideoSyncMode e1, VideoSyncMode e2) + { + return e2.Equals(e1); + } + + /// + /// Overriding != operator for enum VideoSyncMode + /// + public static bool operator != (VideoSyncMode e1, VideoSyncMode e2) + { + return !e2.Equals(e1); + } + + /// + /// Overrides Equals operator for VideoSyncMode + /// + public override bool Equals(object obj) + { + return obj is VideoSyncMode && Equals((VideoSyncMode)obj); + } + + /// + /// Returns for hashCode VideoSyncMode + /// + public override int GetHashCode() + { + return UnderlyingValue.GetHashCode(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncModeConverter.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncModeConverter.cs new file mode 100644 index 0000000000000..3e5c033edf187 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/VideoSyncModeConverter.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media.Models +{ + using Newtonsoft.Json; + + using System.Reflection; + + /// + /// Defines values for VideoSyncMode. + /// + public sealed class VideoSyncModeConverter : JsonConverter + { + + /// + /// Returns if objectType can be converted to VideoSyncMode by the + /// converter. + /// + public override bool CanConvert(System.Type objectType) + { + return typeof(VideoSyncMode).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); + } + + /// + /// Overrides ReadJson and converts token to VideoSyncMode. + /// + public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == Newtonsoft.Json.JsonToken.Null) + { + return null; + } + return (VideoSyncMode)serializer.Deserialize(reader); + } + + /// + /// Overriding WriteJson for VideoSyncMode for serialization. + /// + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + writer.WriteValue(value.ToString()); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..346fdd9b4ec2b --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,851 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get all private endpoint connections. + /// + /// + /// Get all private endpoint connections. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateEndpointConnections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get private endpoint connection. + /// + /// + /// Get private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateEndpointConnections/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update private endpoint connection. + /// + /// + /// Update private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The request parameters + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("name", name); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateEndpointConnections/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete private endpoint connection. + /// + /// + /// Delete private endpoint connection. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateEndpointConnections/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..146c0c6271d28 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,224 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// Get all private endpoint connections. + /// + /// + /// Get all private endpoint connections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + public static PrivateEndpointConnectionListResult List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName) + { + return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Get all private endpoint connections. + /// + /// + /// Get all private endpoint connections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get private endpoint connection. + /// + /// + /// Get private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name) + { + return operations.GetAsync(resourceGroupName, accountName, name).GetAwaiter().GetResult(); + } + + /// + /// Get private endpoint connection. + /// + /// + /// Get private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update private endpoint connection. + /// + /// + /// Update private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The request parameters + /// + public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name, PrivateEndpointConnection parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName, name, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update private endpoint connection. + /// + /// + /// Update private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The request parameters + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, name, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete private endpoint connection. + /// + /// + /// Delete private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name) + { + operations.DeleteAsync(resourceGroupName, accountName, name).GetAwaiter().GetResult(); + } + + /// + /// Delete private endpoint connection. + /// + /// + /// Delete private endpoint connection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..73748e3d175f4 --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,450 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(AzureMediaServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureMediaServicesClient + /// + public AzureMediaServicesClient Client { get; private set; } + + /// + /// Get list of group IDs. + /// + /// + /// Get list of group IDs. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateLinkResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get group ID. + /// + /// + /// Get group ID. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/privateLinkResources/{name}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..c96dc86af35ef --- /dev/null +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,121 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Media +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Get list of group IDs. + /// + /// + /// Get list of group IDs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + public static PrivateLinkResourceListResult List(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Get list of group IDs. + /// + /// + /// Get list of group IDs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get group ID. + /// + /// + /// Get group ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + public static PrivateLinkResource Get(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, string name) + { + return operations.GetAsync(resourceGroupName, accountName, name).GetAwaiter().GetResult(); + } + + /// + /// Get group ID. + /// + /// + /// Get group ID. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the Azure subscription. + /// + /// + /// The Media Services account name. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, string name, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs index 748abf138f052..4c0964651247d 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/SdkInfo_AzureMediaServices.cs @@ -19,33 +19,24 @@ public static IEnumerable> ApiInfo_AzureMediaServi { return new Tuple[] { - new Tuple("Media", "AccountFilters", "2018-07-01"), - new Tuple("Media", "AssetFilters", "2018-07-01"), - new Tuple("Media", "Assets", "2018-07-01"), - new Tuple("Media", "ContentKeyPolicies", "2018-07-01"), - new Tuple("Media", "Jobs", "2018-07-01"), - new Tuple("Media", "LiveEvents", "2018-07-01"), - new Tuple("Media", "LiveOutputs", "2018-07-01"), - new Tuple("Media", "Locations", "2018-07-01"), - new Tuple("Media", "Mediaservices", "2018-07-01"), - new Tuple("Media", "Operations", "2018-07-01"), - new Tuple("Media", "StreamingEndpoints", "2018-07-01"), - new Tuple("Media", "StreamingLocators", "2018-07-01"), - new Tuple("Media", "StreamingPolicies", "2018-07-01"), - new Tuple("Media", "Transforms", "2018-07-01"), + new Tuple("Media", "AccountFilters", "2020-05-01"), + new Tuple("Media", "AssetFilters", "2020-05-01"), + new Tuple("Media", "Assets", "2020-05-01"), + new Tuple("Media", "ContentKeyPolicies", "2020-05-01"), + new Tuple("Media", "Jobs", "2020-05-01"), + new Tuple("Media", "LiveEvents", "2020-05-01"), + new Tuple("Media", "LiveOutputs", "2020-05-01"), + new Tuple("Media", "Locations", "2020-05-01"), + new Tuple("Media", "Mediaservices", "2020-05-01"), + new Tuple("Media", "Operations", "2020-05-01"), + new Tuple("Media", "PrivateEndpointConnections", "2020-05-01"), + new Tuple("Media", "PrivateLinkResources", "2020-05-01"), + new Tuple("Media", "StreamingEndpoints", "2020-05-01"), + new Tuple("Media", "StreamingLocators", "2020-05-01"), + new Tuple("Media", "StreamingPolicies", "2020-05-01"), + new Tuple("Media", "Transforms", "2020-05-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/mediaservices/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --opt-in-extensible-enums --csharp-sdks-folder=D:\\GitHub\\giakasRepros\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "48960215c4923808168e134563f726851b0f5128"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -