diff --git a/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt b/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt index 260c7dfa6b45..c4d5372a9ca9 100644 --- a/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt @@ -3,12 +3,12 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=C:\Git\azure-sdk-for-net\sdk -2019-10-11 21:16:15 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=D:\Projects\azure-sdk-for-net\sdk +2019-11-12 11:18:11 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 6560b6724324bc795979e807bac151336b2b3153 +Commit: 84f0b93b5875248897f38351db6171658e0ae7f0 AutoRest information Requested version: latest -Bootstrapper version: autorest@2.0.4283 +Bootstrapper version: autorest@2.0.4407 diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsLinkedService.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsLinkedService.cs index 75a317ca35c8..65b850d9567f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsLinkedService.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CommonDataServiceForAppsLinkedService.cs @@ -45,12 +45,11 @@ public CommonDataServiceForAppsLinkedService() /// 'OnPremisesWithIfd' /// The authentication type to connect /// to Common Data Service for Apps server. 'Office365' for online - /// scenario, 'Ifd' for on-premises with Ifd scenario. Type: string (or - /// Expression with resultType string). Possible values include: - /// 'Office365', 'Ifd' - /// User name to access the Common Data Service - /// for Apps instance. Type: string (or Expression with resultType - /// string). + /// scenario, 'Ifd' for on-premises with Ifd scenario. + /// 'AADServicePrincipal' for Server-To-Server authentication in online + /// scenario. Type: string (or Expression with resultType string). + /// Possible values include: 'Office365', 'Ifd', + /// 'AADServicePrincipal' /// Unmatched properties from the /// message are deserialized this collection /// The integration runtime reference. @@ -75,13 +74,31 @@ public CommonDataServiceForAppsLinkedService() /// on-prem and required for online when there are more than one Common /// Data Service for Apps instances associated with the user. Type: /// string (or Expression with resultType string). + /// User name to access the Common Data Service + /// for Apps instance. Type: string (or Expression with resultType + /// string). /// Password to access the Common Data Service /// for Apps instance. + /// The client ID of the application + /// in Azure Active Directory used for Server-To-Server authentication. + /// Type: string (or Expression with resultType string). + /// The service principal + /// credential type to use in Server-To-Server authentication. + /// 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for + /// certificate. Type: string (or Expression with resultType + /// string). + /// The credential of the + /// service principal object in Azure Active Directory. If + /// servicePrincipalCredentialType is 'ServicePrincipalKey', + /// servicePrincipalCredential can be SecureString or + /// AzureKeyVaultSecretReference. If servicePrincipalCredentialType is + /// 'ServicePrincipalCert', servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. /// The encrypted credential used for /// authentication. Credentials are encrypted using the integration /// runtime credential manager. Type: string (or Expression with /// resultType string). - public CommonDataServiceForAppsLinkedService(string deploymentType, string authenticationType, object username, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), SecretBase password = default(SecretBase), object encryptedCredential = default(object)) + public CommonDataServiceForAppsLinkedService(string deploymentType, string authenticationType, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), object username = default(object), SecretBase password = default(SecretBase), object servicePrincipalId = default(object), object servicePrincipalCredentialType = default(object), SecretBase servicePrincipalCredential = default(SecretBase), object encryptedCredential = default(object)) : base(additionalProperties, connectVia, description, parameters, annotations) { DeploymentType = deploymentType; @@ -92,6 +109,9 @@ public CommonDataServiceForAppsLinkedService() AuthenticationType = authenticationType; Username = username; Password = password; + ServicePrincipalId = servicePrincipalId; + ServicePrincipalCredentialType = servicePrincipalCredentialType; + ServicePrincipalCredential = servicePrincipalCredential; EncryptedCredential = encryptedCredential; CustomInit(); } @@ -150,8 +170,10 @@ public CommonDataServiceForAppsLinkedService() /// /// Gets or sets the authentication type to connect to Common Data /// Service for Apps server. 'Office365' for online scenario, 'Ifd' for - /// on-premises with Ifd scenario. Type: string (or Expression with - /// resultType string). Possible values include: 'Office365', 'Ifd' + /// on-premises with Ifd scenario. 'AADServicePrincipal' for + /// Server-To-Server authentication in online scenario. Type: string + /// (or Expression with resultType string). Possible values include: + /// 'Office365', 'Ifd', 'AADServicePrincipal' /// [JsonProperty(PropertyName = "typeProperties.authenticationType")] public string AuthenticationType { get; set; } @@ -170,6 +192,35 @@ public CommonDataServiceForAppsLinkedService() [JsonProperty(PropertyName = "typeProperties.password")] public SecretBase Password { get; set; } + /// + /// Gets or sets the client ID of the application in Azure Active + /// Directory used for Server-To-Server authentication. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalId")] + public object ServicePrincipalId { get; set; } + + /// + /// Gets or sets the service principal credential type to use in + /// Server-To-Server authentication. 'ServicePrincipalKey' for + /// key/secret, 'ServicePrincipalCert' for certificate. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredentialType")] + public object ServicePrincipalCredentialType { get; set; } + + /// + /// Gets or sets the credential of the service principal object in + /// Azure Active Directory. If servicePrincipalCredentialType is + /// 'ServicePrincipalKey', servicePrincipalCredential can be + /// SecureString or AzureKeyVaultSecretReference. If + /// servicePrincipalCredentialType is 'ServicePrincipalCert', + /// servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredential")] + public SecretBase ServicePrincipalCredential { get; set; } + /// /// Gets or sets the encrypted credential used for authentication. /// Credentials are encrypted using the integration runtime credential @@ -195,10 +246,6 @@ public override void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AuthenticationType"); } - if (Username == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Username"); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs index ac77e7b741ae..138abe506601 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ComponentSetup.cs @@ -36,7 +36,7 @@ public ComponentSetup() /// component. /// The license key to activate the /// component. - public ComponentSetup(string componentName, SecretBase licenseKey) + public ComponentSetup(string componentName, SecretBase licenseKey = default(SecretBase)) { ComponentName = componentName; LicenseKey = licenseKey; @@ -72,10 +72,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ComponentName"); } - if (LicenseKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LicenseKey"); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandDefaultValue.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandDefaultValue.cs new file mode 100644 index 000000000000..8c0f932ae478 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandDefaultValue.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Default value. + /// + public partial class DWCopyCommandDefaultValue + { + /// + /// Initializes a new instance of the DWCopyCommandDefaultValue class. + /// + public DWCopyCommandDefaultValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DWCopyCommandDefaultValue class. + /// + /// Column name. Type: object (or Expression + /// with resultType string). + /// The default value of the column. Type: + /// object (or Expression with resultType string). + public DWCopyCommandDefaultValue(object columnName = default(object), object defaultValue = default(object)) + { + ColumnName = columnName; + DefaultValue = defaultValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets column name. Type: object (or Expression with + /// resultType string). + /// + [JsonProperty(PropertyName = "columnName")] + public object ColumnName { get; set; } + + /// + /// Gets or sets the default value of the column. Type: object (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "defaultValue")] + public object DefaultValue { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandSettings.cs new file mode 100644 index 000000000000..fc9d34469377 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DWCopyCommandSettings.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// DW Copy Command settings. + /// + public partial class DWCopyCommandSettings + { + /// + /// Initializes a new instance of the DWCopyCommandSettings class. + /// + public DWCopyCommandSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DWCopyCommandSettings class. + /// + /// Specifies the default values for each + /// target column in SQL DW. The default values in the property + /// overwrite the DEFAULT constraint set in the DB, and identity column + /// cannot have a default value. Type: array of objects (or Expression + /// with resultType array of objects). + /// Additional options directly passed + /// to SQL DW in Copy Command. Type: key value pairs (value should be + /// string type) (or Expression with resultType object). Example: + /// "additionalOptions": { "MAXERRORS": "1000", "DATEFORMAT": "'ymd'" + /// } + public DWCopyCommandSettings(IList defaultValues = default(IList), IDictionary additionalOptions = default(IDictionary)) + { + DefaultValues = defaultValues; + AdditionalOptions = additionalOptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies the default values for each target column in + /// SQL DW. The default values in the property overwrite the DEFAULT + /// constraint set in the DB, and identity column cannot have a default + /// value. Type: array of objects (or Expression with resultType array + /// of objects). + /// + [JsonProperty(PropertyName = "defaultValues")] + public IList DefaultValues { get; set; } + + /// + /// Gets or sets additional options directly passed to SQL DW in Copy + /// Command. Type: key value pairs (value should be string type) (or + /// Expression with resultType object). Example: "additionalOptions": { + /// "MAXERRORS": "1000", "DATEFORMAT": "'ymd'" } + /// + [JsonProperty(PropertyName = "additionalOptions")] + public IDictionary AdditionalOptions { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsAuthenticationType.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsAuthenticationType.cs index 614215a7b1b4..83d41ff53edc 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsAuthenticationType.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsAuthenticationType.cs @@ -18,5 +18,6 @@ public static class DynamicsAuthenticationType { public const string Office365 = "Office365"; public const string Ifd = "Ifd"; + public const string AADServicePrincipal = "AADServicePrincipal"; } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmLinkedService.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmLinkedService.cs index 259839e75d2d..2d0c6807e1a4 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmLinkedService.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsCrmLinkedService.cs @@ -42,12 +42,10 @@ public DynamicsCrmLinkedService() /// include: 'Online', 'OnPremisesWithIfd' /// The authentication type to connect /// to Dynamics CRM server. 'Office365' for online scenario, 'Ifd' for - /// on-premises with Ifd scenario. Type: string (or Expression with - /// resultType string). Possible values include: 'Office365', - /// 'Ifd' - /// User name to access the Dynamics CRM - /// instance. Type: string (or Expression with resultType - /// string). + /// on-premises with Ifd scenario, 'AADServicePrincipal' for + /// Server-To-Server authentication in online scenario. Type: string + /// (or Expression with resultType string). Possible values include: + /// 'Office365', 'Ifd', 'AADServicePrincipal' /// Unmatched properties from the /// message are deserialized this collection /// The integration runtime reference. @@ -72,13 +70,31 @@ public DynamicsCrmLinkedService() /// required for online when there are more than one Dynamics CRM /// instances associated with the user. Type: string (or Expression /// with resultType string). + /// User name to access the Dynamics CRM + /// instance. Type: string (or Expression with resultType + /// string). /// Password to access the Dynamics CRM /// instance. + /// The client ID of the application + /// in Azure Active Directory used for Server-To-Server authentication. + /// Type: string (or Expression with resultType string). + /// The service principal + /// credential type to use in Server-To-Server authentication. + /// 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for + /// certificate. Type: string (or Expression with resultType + /// string). + /// The credential of the + /// service principal object in Azure Active Directory. If + /// servicePrincipalCredentialType is 'ServicePrincipalKey', + /// servicePrincipalCredential can be SecureString or + /// AzureKeyVaultSecretReference. If servicePrincipalCredentialType is + /// 'ServicePrincipalCert', servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. /// The encrypted credential used for /// authentication. Credentials are encrypted using the integration /// runtime credential manager. Type: string (or Expression with /// resultType string). - public DynamicsCrmLinkedService(string deploymentType, string authenticationType, object username, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), SecretBase password = default(SecretBase), object encryptedCredential = default(object)) + public DynamicsCrmLinkedService(string deploymentType, string authenticationType, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), object username = default(object), SecretBase password = default(SecretBase), object servicePrincipalId = default(object), object servicePrincipalCredentialType = default(object), SecretBase servicePrincipalCredential = default(SecretBase), object encryptedCredential = default(object)) : base(additionalProperties, connectVia, description, parameters, annotations) { DeploymentType = deploymentType; @@ -89,6 +105,9 @@ public DynamicsCrmLinkedService() AuthenticationType = authenticationType; Username = username; Password = password; + ServicePrincipalId = servicePrincipalId; + ServicePrincipalCredentialType = servicePrincipalCredentialType; + ServicePrincipalCredential = servicePrincipalCredential; EncryptedCredential = encryptedCredential; CustomInit(); } @@ -145,8 +164,10 @@ public DynamicsCrmLinkedService() /// /// Gets or sets the authentication type to connect to Dynamics CRM /// server. 'Office365' for online scenario, 'Ifd' for on-premises with - /// Ifd scenario. Type: string (or Expression with resultType string). - /// Possible values include: 'Office365', 'Ifd' + /// Ifd scenario, 'AADServicePrincipal' for Server-To-Server + /// authentication in online scenario. Type: string (or Expression with + /// resultType string). Possible values include: 'Office365', 'Ifd', + /// 'AADServicePrincipal' /// [JsonProperty(PropertyName = "typeProperties.authenticationType")] public string AuthenticationType { get; set; } @@ -164,6 +185,35 @@ public DynamicsCrmLinkedService() [JsonProperty(PropertyName = "typeProperties.password")] public SecretBase Password { get; set; } + /// + /// Gets or sets the client ID of the application in Azure Active + /// Directory used for Server-To-Server authentication. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalId")] + public object ServicePrincipalId { get; set; } + + /// + /// Gets or sets the service principal credential type to use in + /// Server-To-Server authentication. 'ServicePrincipalKey' for + /// key/secret, 'ServicePrincipalCert' for certificate. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredentialType")] + public object ServicePrincipalCredentialType { get; set; } + + /// + /// Gets or sets the credential of the service principal object in + /// Azure Active Directory. If servicePrincipalCredentialType is + /// 'ServicePrincipalKey', servicePrincipalCredential can be + /// SecureString or AzureKeyVaultSecretReference. If + /// servicePrincipalCredentialType is 'ServicePrincipalCert', + /// servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredential")] + public SecretBase ServicePrincipalCredential { get; set; } + /// /// Gets or sets the encrypted credential used for authentication. /// Credentials are encrypted using the integration runtime credential @@ -189,10 +239,6 @@ public override void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AuthenticationType"); } - if (Username == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Username"); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsLinkedService.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsLinkedService.cs index e0ffeaad8f51..8bc7dbd7d0eb 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsLinkedService.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DynamicsLinkedService.cs @@ -41,10 +41,9 @@ public DynamicsLinkedService() /// resultType string). /// The authentication type to connect /// to Dynamics server. 'Office365' for online scenario, 'Ifd' for - /// on-premises with Ifd scenario. Type: string (or Expression with - /// resultType string). - /// User name to access the Dynamics instance. - /// Type: string (or Expression with resultType string). + /// on-premises with Ifd scenario, 'AADServicePrincipal' for + /// Server-To-Server authentication in online scenario. Type: string + /// (or Expression with resultType string). /// Unmatched properties from the /// message are deserialized this collection /// The integration runtime reference. @@ -68,13 +67,30 @@ public DynamicsLinkedService() /// required for online when there are more than one Dynamics instances /// associated with the user. Type: string (or Expression with /// resultType string). + /// User name to access the Dynamics instance. + /// Type: string (or Expression with resultType string). /// Password to access the Dynamics /// instance. + /// The client ID of the application + /// in Azure Active Directory used for Server-To-Server authentication. + /// Type: string (or Expression with resultType string). + /// The service principal + /// credential type to use in Server-To-Server authentication. + /// 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for + /// certificate. Type: string (or Expression with resultType + /// string). + /// The credential of the + /// service principal object in Azure Active Directory. If + /// servicePrincipalCredentialType is 'ServicePrincipalKey', + /// servicePrincipalCredential can be SecureString or + /// AzureKeyVaultSecretReference. If servicePrincipalCredentialType is + /// 'ServicePrincipalCert', servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. /// The encrypted credential used for /// authentication. Credentials are encrypted using the integration /// runtime credential manager. Type: string (or Expression with /// resultType string). - public DynamicsLinkedService(object deploymentType, object authenticationType, object username, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), SecretBase password = default(SecretBase), object encryptedCredential = default(object)) + public DynamicsLinkedService(object deploymentType, object authenticationType, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object hostName = default(object), object port = default(object), object serviceUri = default(object), object organizationName = default(object), object username = default(object), SecretBase password = default(SecretBase), object servicePrincipalId = default(object), object servicePrincipalCredentialType = default(object), SecretBase servicePrincipalCredential = default(SecretBase), object encryptedCredential = default(object)) : base(additionalProperties, connectVia, description, parameters, annotations) { DeploymentType = deploymentType; @@ -85,6 +101,9 @@ public DynamicsLinkedService() AuthenticationType = authenticationType; Username = username; Password = password; + ServicePrincipalId = servicePrincipalId; + ServicePrincipalCredentialType = servicePrincipalCredentialType; + ServicePrincipalCredential = servicePrincipalCredential; EncryptedCredential = encryptedCredential; CustomInit(); } @@ -139,7 +158,9 @@ public DynamicsLinkedService() /// /// Gets or sets the authentication type to connect to Dynamics server. /// 'Office365' for online scenario, 'Ifd' for on-premises with Ifd - /// scenario. Type: string (or Expression with resultType string). + /// scenario, 'AADServicePrincipal' for Server-To-Server authentication + /// in online scenario. Type: string (or Expression with resultType + /// string). /// [JsonProperty(PropertyName = "typeProperties.authenticationType")] public object AuthenticationType { get; set; } @@ -157,6 +178,35 @@ public DynamicsLinkedService() [JsonProperty(PropertyName = "typeProperties.password")] public SecretBase Password { get; set; } + /// + /// Gets or sets the client ID of the application in Azure Active + /// Directory used for Server-To-Server authentication. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalId")] + public object ServicePrincipalId { get; set; } + + /// + /// Gets or sets the service principal credential type to use in + /// Server-To-Server authentication. 'ServicePrincipalKey' for + /// key/secret, 'ServicePrincipalCert' for certificate. Type: string + /// (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredentialType")] + public object ServicePrincipalCredentialType { get; set; } + + /// + /// Gets or sets the credential of the service principal object in + /// Azure Active Directory. If servicePrincipalCredentialType is + /// 'ServicePrincipalKey', servicePrincipalCredential can be + /// SecureString or AzureKeyVaultSecretReference. If + /// servicePrincipalCredentialType is 'ServicePrincipalCert', + /// servicePrincipalCredential can only be + /// AzureKeyVaultSecretReference. + /// + [JsonProperty(PropertyName = "typeProperties.servicePrincipalCredential")] + public SecretBase ServicePrincipalCredential { get; set; } + /// /// Gets or sets the encrypted credential used for authentication. /// Credentials are encrypted using the integration runtime credential @@ -182,10 +232,6 @@ public override void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "AuthenticationType"); } - if (Username == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Username"); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcCompressionCodec.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcCompressionCodec.cs new file mode 100644 index 000000000000..4c34dd3a5833 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcCompressionCodec.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code 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.DataFactory.Models +{ + + /// + /// Defines values for OrcCompressionCodec. + /// + public static class OrcCompressionCodec + { + public const string None = "none"; + public const string Zlib = "zlib"; + public const string Snappy = "snappy"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcDataset.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcDataset.cs index ab3d94b1cc48..a4f9322167b0 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcDataset.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/OrcDataset.cs @@ -53,10 +53,13 @@ public OrcDataset() /// describing the Dataset. /// The folder that this Dataset is in. If not /// specified, Dataset will appear at the root level. - public OrcDataset(LinkedServiceReference linkedServiceName, DatasetLocation location, IDictionary additionalProperties = default(IDictionary), string description = default(string), object structure = default(object), object schema = default(object), IDictionary parameters = default(IDictionary), IList annotations = default(IList), DatasetFolder folder = default(DatasetFolder)) + /// Possible values include: 'none', + /// 'zlib', 'snappy' + public OrcDataset(LinkedServiceReference linkedServiceName, DatasetLocation location, IDictionary additionalProperties = default(IDictionary), string description = default(string), object structure = default(object), object schema = default(object), IDictionary parameters = default(IDictionary), IList annotations = default(IList), DatasetFolder folder = default(DatasetFolder), string orcCompressionCodec = default(string)) : base(linkedServiceName, additionalProperties, description, structure, schema, parameters, annotations, folder) { Location = location; + OrcCompressionCodec = orcCompressionCodec; CustomInit(); } @@ -71,6 +74,12 @@ public OrcDataset() [JsonProperty(PropertyName = "typeProperties.location")] public DatasetLocation Location { get; set; } + /// + /// Gets or sets possible values include: 'none', 'zlib', 'snappy' + /// + [JsonProperty(PropertyName = "typeProperties.orcCompressionCodec")] + public string OrcCompressionCodec { get; set; } + /// /// Validate the object. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISAccessCredential.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISAccessCredential.cs index 79818e92cc1e..3a1eea512a78 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISAccessCredential.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISAccessCredential.cs @@ -33,7 +33,7 @@ public SSISAccessCredential() /// Domain for windows authentication. /// UseName for windows authentication. /// Password for windows authentication. - public SSISAccessCredential(object domain, object userName, SecureString password) + public SSISAccessCredential(object domain, object userName, SecretBase password) { Domain = domain; UserName = userName; @@ -62,7 +62,7 @@ public SSISAccessCredential(object domain, object userName, SecureString passwor /// Gets or sets password for windows authentication. /// [JsonProperty(PropertyName = "password")] - public SecureString Password { get; set; } + public SecretBase Password { get; set; } /// /// Validate the object. @@ -84,10 +84,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Password"); } - if (Password != null) - { - Password.Validate(); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISChildPackage.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISChildPackage.cs new file mode 100644 index 000000000000..e05fea4cc933 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISChildPackage.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.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// SSIS embedded child package. + /// + public partial class SSISChildPackage + { + /// + /// Initializes a new instance of the SSISChildPackage class. + /// + public SSISChildPackage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SSISChildPackage class. + /// + /// Path for embedded child package. Type: + /// string (or Expression with resultType string). + /// Content for embedded child package. + /// Type: string (or Expression with resultType string). + /// Name for embedded child package. + /// Last modified date for + /// embedded child package. + public SSISChildPackage(object packagePath, object packageContent, string packageName = default(string), string packageLastModifiedDate = default(string)) + { + PackagePath = packagePath; + PackageName = packageName; + PackageContent = packageContent; + PackageLastModifiedDate = packageLastModifiedDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets path for embedded child package. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "packagePath")] + public object PackagePath { get; set; } + + /// + /// Gets or sets name for embedded child package. + /// + [JsonProperty(PropertyName = "packageName")] + public string PackageName { get; set; } + + /// + /// Gets or sets content for embedded child package. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "packageContent")] + public object PackageContent { get; set; } + + /// + /// Gets or sets last modified date for embedded child package. + /// + [JsonProperty(PropertyName = "packageLastModifiedDate")] + public string PackageLastModifiedDate { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PackagePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PackagePath"); + } + if (PackageContent == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PackageContent"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs index 665789d11e24..f65e11b3dc10 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs @@ -53,15 +53,22 @@ public SqlDWSink() /// Expression with resultType boolean). /// Specifies PolyBase-related settings /// when allowPolyBase is true. + /// Indicates to use Copy Command to + /// copy data into SQL Data Warehouse. Type: boolean (or Expression + /// with resultType boolean). + /// Specifies Copy Command related + /// settings when allowCopyCommand is true. /// The option to handle sink table, such as /// autoCreate. For now only 'autoCreate' value is supported. Type: /// string (or Expression with resultType string). - public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings), object tableOption = default(object)) + public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings), object allowCopyCommand = default(object), DWCopyCommandSettings copyCommandSettings = default(DWCopyCommandSettings), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { PreCopyScript = preCopyScript; AllowPolyBase = allowPolyBase; PolyBaseSettings = polyBaseSettings; + AllowCopyCommand = allowCopyCommand; + CopyCommandSettings = copyCommandSettings; TableOption = tableOption; CustomInit(); } @@ -93,6 +100,21 @@ public SqlDWSink() [JsonProperty(PropertyName = "polyBaseSettings")] public PolybaseSettings PolyBaseSettings { get; set; } + /// + /// Gets or sets indicates to use Copy Command to copy data into SQL + /// Data Warehouse. Type: boolean (or Expression with resultType + /// boolean). + /// + [JsonProperty(PropertyName = "allowCopyCommand")] + public object AllowCopyCommand { get; set; } + + /// + /// Gets or sets specifies Copy Command related settings when + /// allowCopyCommand is true. + /// + [JsonProperty(PropertyName = "copyCommandSettings")] + public DWCopyCommandSettings CopyCommandSettings { get; set; } + /// /// Gets or sets the option to handle sink table, such as autoCreate. /// For now only 'autoCreate' value is supported. Type: string (or diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs index b15e46801a6d..602b4a64b6db 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.DataFactory.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -35,20 +37,31 @@ public SSISPackageLocation() /// The SSIS package path. Type: string (or /// Expression with resultType string). /// The type of SSIS package location. Possible - /// values include: 'SSISDB', 'File' + /// values include: 'SSISDB', 'File', 'InlinePackage' /// Password of the package. /// The package access /// credential. /// The configuration file of the /// package execution. Type: string (or Expression with resultType /// string). - public SSISPackageLocation(object packagePath, string type = default(string), SecureString packagePassword = default(SecureString), SSISAccessCredential accessCredential = default(SSISAccessCredential), object configurationPath = default(object)) + /// The package name. + /// The embedded package content. Type: + /// string (or Expression with resultType string). + /// The embedded package last + /// modified date. + /// The embedded child package + /// list. + public SSISPackageLocation(object packagePath = default(object), string type = default(string), SecretBase packagePassword = default(SecretBase), SSISAccessCredential accessCredential = default(SSISAccessCredential), object configurationPath = default(object), string packageName = default(string), object packageContent = default(object), string packageLastModifiedDate = default(string), IList childPackages = default(IList)) { PackagePath = packagePath; Type = type; PackagePassword = packagePassword; AccessCredential = accessCredential; ConfigurationPath = configurationPath; + PackageName = packageName; + PackageContent = packageContent; + PackageLastModifiedDate = packageLastModifiedDate; + ChildPackages = childPackages; CustomInit(); } @@ -66,7 +79,7 @@ public SSISPackageLocation() /// /// Gets or sets the type of SSIS package location. Possible values - /// include: 'SSISDB', 'File' + /// include: 'SSISDB', 'File', 'InlinePackage' /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } @@ -75,7 +88,7 @@ public SSISPackageLocation() /// Gets or sets password of the package. /// [JsonProperty(PropertyName = "typeProperties.packagePassword")] - public SecureString PackagePassword { get; set; } + public SecretBase PackagePassword { get; set; } /// /// Gets or sets the package access credential. @@ -90,6 +103,31 @@ public SSISPackageLocation() [JsonProperty(PropertyName = "typeProperties.configurationPath")] public object ConfigurationPath { get; set; } + /// + /// Gets or sets the package name. + /// + [JsonProperty(PropertyName = "typeProperties.packageName")] + public string PackageName { get; set; } + + /// + /// Gets or sets the embedded package content. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.packageContent")] + public object PackageContent { get; set; } + + /// + /// Gets or sets the embedded package last modified date. + /// + [JsonProperty(PropertyName = "typeProperties.packageLastModifiedDate")] + public string PackageLastModifiedDate { get; set; } + + /// + /// Gets or sets the embedded child package list. + /// + [JsonProperty(PropertyName = "typeProperties.childPackages")] + public IList ChildPackages { get; set; } + /// /// Validate the object. /// @@ -98,18 +136,20 @@ public SSISPackageLocation() /// public virtual void Validate() { - if (PackagePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PackagePath"); - } - if (PackagePassword != null) - { - PackagePassword.Validate(); - } if (AccessCredential != null) { AccessCredential.Validate(); } + if (ChildPackages != null) + { + foreach (var element in ChildPackages) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocationType.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocationType.cs index ad8eb8fdd96c..9640cd9e0b8c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocationType.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocationType.cs @@ -18,5 +18,6 @@ public static class SsisPackageLocationType { public const string SSISDB = "SSISDB"; public const string File = "File"; + public const string InlinePackage = "InlinePackage"; } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivity.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivity.cs index 9826761b65aa..22903288be1c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivity.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivity.cs @@ -60,7 +60,8 @@ public WebActivity() /// endpoint. /// List of linked services passed to web /// endpoint. - public WebActivity(string name, string method, object url, IDictionary additionalProperties = default(IDictionary), string description = default(string), IList dependsOn = default(IList), IList userProperties = default(IList), LinkedServiceReference linkedServiceName = default(LinkedServiceReference), ActivityPolicy policy = default(ActivityPolicy), object headers = default(object), object body = default(object), WebActivityAuthentication authentication = default(WebActivityAuthentication), IList datasets = default(IList), IList linkedServices = default(IList)) + /// The integration runtime reference. + public WebActivity(string name, string method, object url, IDictionary additionalProperties = default(IDictionary), string description = default(string), IList dependsOn = default(IList), IList userProperties = default(IList), LinkedServiceReference linkedServiceName = default(LinkedServiceReference), ActivityPolicy policy = default(ActivityPolicy), object headers = default(object), object body = default(object), WebActivityAuthentication authentication = default(WebActivityAuthentication), IList datasets = default(IList), IList linkedServices = default(IList), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference)) : base(name, additionalProperties, description, dependsOn, userProperties, linkedServiceName, policy) { Method = method; @@ -70,6 +71,7 @@ public WebActivity() Authentication = authentication; Datasets = datasets; LinkedServices = linkedServices; + ConnectVia = connectVia; CustomInit(); } @@ -128,6 +130,12 @@ public WebActivity() [JsonProperty(PropertyName = "typeProperties.linkedServices")] public IList LinkedServices { get; set; } + /// + /// Gets or sets the integration runtime reference. + /// + [JsonProperty(PropertyName = "typeProperties.connectVia")] + public IntegrationRuntimeReference ConnectVia { get; set; } + /// /// Validate the object. /// @@ -169,6 +177,10 @@ public override void Validate() } } } + if (ConnectVia != null) + { + ConnectVia.Validate(); + } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivityAuthentication.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivityAuthentication.cs index 38ff18549b55..e18ed9592e1f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivityAuthentication.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebActivityAuthentication.cs @@ -39,7 +39,7 @@ public WebActivityAuthentication() /// authentication. /// Resource for which Azure Auth token will be /// requested when using MSI Authentication. - public WebActivityAuthentication(string type, SecureString pfx = default(SecureString), string username = default(string), SecureString password = default(SecureString), string resource = default(string)) + public WebActivityAuthentication(string type, SecretBase pfx = default(SecretBase), string username = default(string), SecretBase password = default(SecretBase), string resource = default(string)) { Type = type; Pfx = pfx; @@ -65,7 +65,7 @@ public WebActivityAuthentication() /// Gets or sets base64-encoded contents of a PFX file. /// [JsonProperty(PropertyName = "pfx")] - public SecureString Pfx { get; set; } + public SecretBase Pfx { get; set; } /// /// Gets or sets web activity authentication user name for basic @@ -78,7 +78,7 @@ public WebActivityAuthentication() /// Gets or sets password for the PFX file or basic authentication. /// [JsonProperty(PropertyName = "password")] - public SecureString Password { get; set; } + public SecretBase Password { get; set; } /// /// Gets or sets resource for which Azure Auth token will be requested @@ -99,14 +99,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Type"); } - if (Pfx != null) - { - Pfx.Validate(); - } - if (Password != null) - { - Password.Validate(); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebHookActivity.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebHookActivity.cs index be2bf928688e..90a9110d80a4 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebHookActivity.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/WebHookActivity.cs @@ -57,7 +57,12 @@ public WebHookActivity() /// Type: string (or Expression with resultType string). /// Authentication method used for calling /// the endpoint. - public WebHookActivity(string name, object url, IDictionary additionalProperties = default(IDictionary), string description = default(string), IList dependsOn = default(IList), IList userProperties = default(IList), string timeout = default(string), object headers = default(object), object body = default(object), WebActivityAuthentication authentication = default(WebActivityAuthentication)) + /// When set to true, statusCode, + /// output and error in callback request body will be consumed by + /// activity. The activity can be marked as failed by setting + /// statusCode >= 400 in callback request. Default is false. Type: + /// boolean (or Expression with resultType boolean). + public WebHookActivity(string name, object url, IDictionary additionalProperties = default(IDictionary), string description = default(string), IList dependsOn = default(IList), IList userProperties = default(IList), string timeout = default(string), object headers = default(object), object body = default(object), WebActivityAuthentication authentication = default(WebActivityAuthentication), object reportStatusOnCallBack = default(object)) : base(name, additionalProperties, description, dependsOn, userProperties) { Url = url; @@ -65,6 +70,7 @@ public WebHookActivity() Headers = headers; Body = body; Authentication = authentication; + ReportStatusOnCallBack = reportStatusOnCallBack; CustomInit(); } /// @@ -120,6 +126,16 @@ static WebHookActivity() [JsonProperty(PropertyName = "typeProperties.authentication")] public WebActivityAuthentication Authentication { get; set; } + /// + /// Gets or sets when set to true, statusCode, output and error in + /// callback request body will be consumed by activity. The activity + /// can be marked as failed by setting statusCode >= 400 in + /// callback request. Default is false. Type: boolean (or Expression + /// with resultType boolean). + /// + [JsonProperty(PropertyName = "typeProperties.reportStatusOnCallBack")] + public object ReportStatusOnCallBack { get; set; } + /// /// Rest API method for target endpoint. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs index 493bfddc1796..8e451c8aa399 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs @@ -40,11 +40,11 @@ public static IEnumerable> ApiInfo_DataFactoryMana } // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=C:\\Git\\azure-sdk-for-net\\sdk"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=D:\\Projects\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "6560b6724324bc795979e807bac151336b2b3153"; + public static readonly String GithubCommidId = "84f0b93b5875248897f38351db6171658e0ae7f0"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/storage/Azure.Storage.Blobs.Batching/tests/BlobTestBase.cs b/sdk/storage/Azure.Storage.Blobs.Batching/tests/BlobTestBase.cs index a38520b13ebe..7ca596fd7544 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batching/tests/BlobTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs.Batching/tests/BlobTestBase.cs @@ -248,8 +248,8 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential => new AccountSasBuilder { Protocol = SasProtocol.None, - Services = AccountSasServices.Blobs, - ResourceTypes = AccountSasResourceTypes.Container | AccountSasResourceTypes.Object, + Services = new AccountSasServices { Blobs = true }.ToString(), + ResourceTypes = new AccountSasResourceTypes { BlobContainer = true, Object = true }.ToString(), StartTime = Recording.UtcNow.AddHours(-1), ExpiryTime = Recording.UtcNow.AddHours(+1), Permissions = new BlobContainerSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true, List = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs b/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs index 32ee1c45d3a7..ef3c118547bb 100644 --- a/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs +++ b/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs @@ -141,10 +141,10 @@ public async Task SharedAccessSignatureAuthAsync() AccountSasBuilder sas = new AccountSasBuilder { // Allow access to blobs - Services = AccountSasServices.Blobs, + Services = new AccountSasServices() { Blobs = true }.ToString(), // Allow access to the service level APIs - ResourceTypes = AccountSasResourceTypes.Service, + ResourceTypes = new AccountSasResourceTypes() { Service = true }.ToString(), // Allow read access Permissions = new AccountSasPermissions() { Read = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs index ffc1281f9ab4..c183f4658626 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs @@ -178,8 +178,8 @@ public BlobSasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential sh var p = new BlobSasQueryParameters( version: Version, - services: default, - resourceTypes: default, + services: null, + resourceTypes: null, protocol: Protocol, startTime: StartTime, expiryTime: ExpiryTime, @@ -247,8 +247,8 @@ public BlobSasQueryParameters ToSasQueryParameters(UserDelegationKey userDelegat var p = new BlobSasQueryParameters( version: Version, - services: default, - resourceTypes: default, + services: null, + resourceTypes: null, protocol: Protocol, startTime: StartTime, expiryTime: ExpiryTime, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs index 7c88b3f25255..04ce6a7b8c22 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs @@ -63,8 +63,8 @@ internal BlobSasQueryParameters() /// internal BlobSasQueryParameters( string version, - AccountSasServices? services, - AccountSasResourceTypes? resourceTypes, + string services, + string resourceTypes, SasProtocol protocol, DateTimeOffset startTime, DateTimeOffset expiryTime, diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobSasBuilderTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobSasBuilderTests.cs index 7c5fae8149fa..9cdfdac748ba 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobSasBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobSasBuilderTests.cs @@ -49,8 +49,8 @@ public void ToSasQueryParameters_ContainerTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -77,8 +77,8 @@ public void ToSasQueryParameters_ContainerIdentityTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -111,8 +111,8 @@ public void ToSasQueryParameters_BlobTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -139,8 +139,8 @@ public void ToSasQueryParameters_BlobIdentityTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -173,8 +173,8 @@ public void ToSasQueryParameters_SnapshotTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -201,8 +201,8 @@ public void ToSasQueryParameters_SnapshotIdentityTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(String.Empty, sasQueryParameters.Services); + Assert.AreEqual(String.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs index 6d712c6dcd94..35fb61ef0f93 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs @@ -249,8 +249,8 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential => new AccountSasBuilder { Protocol = SasProtocol.None, - Services = AccountSasServices.Blobs, - ResourceTypes = AccountSasResourceTypes.Container | AccountSasResourceTypes.Object, + Services = new AccountSasServices { Blobs = true }.ToString(), + ResourceTypes = new AccountSasResourceTypes { BlobContainer = true, Object = true }.ToString(), StartTime = Recording.UtcNow.AddHours(-1), ExpiryTime = Recording.UtcNow.AddHours(+1), Permissions = new BlobContainerSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true, List = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs index 045188fbe237..20f98f65c077 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs @@ -175,8 +175,8 @@ public void BlobUriBuilder_RegularUrl_SasTest() Assert.AreEqual("rw", blobUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, blobUriBuilder.Sas.Protocol); Assert.AreEqual("b", blobUriBuilder.Sas.Resource); - Assert.IsNull(blobUriBuilder.Sas.ResourceTypes); - Assert.IsNull(blobUriBuilder.Sas.Services); + Assert.AreEqual("", blobUriBuilder.Sas.ResourceTypes); + Assert.AreEqual("", blobUriBuilder.Sas.Services); Assert.AreEqual("Z/RHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk=", blobUriBuilder.Sas.Signature); Assert.AreEqual(new DateTimeOffset(2015, 4, 29, 22, 18, 26, TimeSpan.Zero), blobUriBuilder.Sas.StartTime); Assert.AreEqual("2015-04-05", blobUriBuilder.Sas.Version); @@ -336,8 +336,8 @@ public void BlobUriBuilder_IPStyleUrl_SasTest() Assert.AreEqual("rw", blobUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, blobUriBuilder.Sas.Protocol); Assert.AreEqual("b", blobUriBuilder.Sas.Resource); - Assert.IsNull(blobUriBuilder.Sas.ResourceTypes); - Assert.IsNull(blobUriBuilder.Sas.Services); + Assert.AreEqual("", blobUriBuilder.Sas.ResourceTypes); + Assert.AreEqual("", blobUriBuilder.Sas.Services); Assert.AreEqual("Z/RHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk=", blobUriBuilder.Sas.Signature); Assert.AreEqual(new DateTimeOffset(2015, 4, 29, 22, 18, 26, TimeSpan.Zero), blobUriBuilder.Sas.StartTime); Assert.AreEqual("2015-04-05", blobUriBuilder.Sas.Version); diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs index e0cadb9a9397..15103add2222 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs @@ -20,8 +20,8 @@ public SasQueryParametersTests(bool async) public void SasQueryParameters_RoundTrip() { var version = "2018-03-28"; - AccountSasServices service = AccountSasServices.Blobs; - AccountSasResourceTypes resourceType = AccountSasResourceTypes.Container; + var service = "b"; + var resourceType = "c"; SasProtocol protocol = SasProtocol.Https; DateTimeOffset startTime = DateTimeOffset.Now; DateTimeOffset expiryTime = startTime.AddDays(1); diff --git a/sdk/storage/Azure.Storage.Common/src/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Constants.cs index f5e3173b1f57..fb2ff957ee40 100644 --- a/sdk/storage/Azure.Storage.Common/src/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Constants.cs @@ -464,7 +464,7 @@ internal static class AccountServices internal static class AccountResources { public const char Service = 's'; - public const char Container = 'c'; + public const char BlobContainer = 'c'; public const char Object = 'o'; } } diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs index de3d8be94d0f..a55f3789251a 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs @@ -65,15 +65,19 @@ public struct AccountSasBuilder : IEquatable /// /// The services associated with the shared access signature. The - /// user is restricted to operations with the specified services. + /// user is restricted to operations with the specified services. The + /// type can be used to create the + /// services string. /// - public AccountSasServices Services { get; set; } + public string Services { get; set; } /// /// The resource types associated with the shared access signature. The - /// user is restricted to operations on the specified resources. + /// user is restricted to operations on the specified resources. The + /// type can be used to create + /// the resource types string. /// - public AccountSasResourceTypes ResourceTypes { get; set; } + public string ResourceTypes { get; set; } /// /// Use an account's to sign this @@ -92,7 +96,7 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared // https://docs.microsoft.com/en-us/rest/api/storageservices/Constructing-an-Account-SAS sharedKeyCredential = sharedKeyCredential ?? throw Errors.ArgumentNull(nameof(sharedKeyCredential)); - if (ExpiryTime == default || string.IsNullOrEmpty(Permissions) || ResourceTypes == default || Services == default) + if (ExpiryTime == default || string.IsNullOrEmpty(Permissions) || string.IsNullOrEmpty(ResourceTypes) || string.IsNullOrEmpty(Services)) { throw Errors.AccountSasMissingData(); } @@ -109,12 +113,12 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared var stringToSign = string.Join("\n", sharedKeyCredential.AccountName, Permissions, - Services.ToPermissionsString(), - ResourceTypes.ToPermissionsString(), + Services, + ResourceTypes, startTime, expiryTime, IPRange.ToString(), - Protocol.ToProtocolString(), + Protocol.ToString(), Version, ""); // That's right, the account SAS requires a terminating extra newline @@ -162,8 +166,8 @@ public override int GetHashCode() => IPRange.GetHashCode() ^ (Permissions?.GetHashCode() ?? 0) ^ Protocol.GetHashCode() ^ - ResourceTypes.GetHashCode() ^ - (Services.GetHashCode()) ^ + (ResourceTypes?.GetHashCode() ?? 0) ^ + (Services?.GetHashCode() ?? 0) ^ StartTime.GetHashCode() ^ (Version?.GetHashCode() ?? 0); diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasResourceTypes.cs b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasResourceTypes.cs index 01878665b620..77a5284e4399 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasResourceTypes.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasResourceTypes.cs @@ -2,80 +2,108 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; using System.Text; namespace Azure.Storage.Sas { /// /// Specifies the resource types accessible from an account level shared - /// access signature. + /// access signature. Use to produce a value that + /// can be used for . /// - [Flags] - public enum AccountSasResourceTypes + public struct AccountSasResourceTypes : IEquatable { /// - /// Indicates whether service-level APIs are accessible + /// Gets a value indicating whether service-level APIs are accessible /// from this shared access signature (e.g., Get/Set Service /// Properties, Get Service Stats, List Containers/Queues/Tables/ /// Shares). /// - Service = 1, + public bool Service { get; set; } /// - /// Indicates whether blob container-level APIs are accessible + /// Gets a value indicating whether blob container-level APIs are accessible /// from this shared access signature (e.g., Create/Delete Container, /// Create/Delete Queue, Create/Delete Table, Create/Delete Share, List /// Blobs/Files and Directories). /// - Container = 2, + public bool BlobContainer { get; set; } #pragma warning disable CA1720 // Identifier contains type name /// - /// Indicates whether object-level APIs for blobs, queue + /// Gets a value indicating whether object-level APIs for blobs, queue /// messages, and files are accessible from this shared access /// signature (e.g. Put Blob, Query Entity, Get Messages, Create File, /// etc.). /// - Object = 4, + public bool Object { get; set; } #pragma warning restore CA1720 // Identifier contains type name - /// - /// Indicates all service-level APIs are accessible from this shared - /// access signature. - /// - All = ~0 - } - - /// - /// Extension methods for AccountSasResourceTypes enum - /// - internal static partial class SasExtensions - { /// /// Creates a string representing which resource types are allowed /// for . /// /// - /// A string representing which resource types are allowed. + /// A string representing which services are allowed. /// - internal static string ToPermissionsString(this AccountSasResourceTypes resourceTypes) + public override string ToString() { var sb = new StringBuilder(); - if ((resourceTypes & AccountSasResourceTypes.Service) == AccountSasResourceTypes.Service) - { - sb.Append(Constants.Sas.AccountResources.Service); - } - if ((resourceTypes & AccountSasResourceTypes.Container) == AccountSasResourceTypes.Container) - { - sb.Append(Constants.Sas.AccountResources.Container); - } - if ((resourceTypes & AccountSasResourceTypes.Object) == AccountSasResourceTypes.Object) - { - sb.Append(Constants.Sas.AccountResources.Object); - } + if (Service) { sb.Append(Constants.Sas.AccountResources.Service); } + if (BlobContainer) { sb.Append(Constants.Sas.AccountResources.BlobContainer); } + if (Object) { sb.Append(Constants.Sas.AccountResources.Object); } return sb.ToString(); } + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => + obj is AccountSasResourceTypes other && + Equals(other); + + /// + /// Get a hash code for the . + /// + /// Hash code for the . + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => + (Service ? 0b001 : 0) + + (BlobContainer ? 0b010 : 0) + + (Object ? 0b100 : 0); + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + public bool Equals(AccountSasResourceTypes other) => + other.Service == Service && + other.BlobContainer == BlobContainer && + other.Object == Object; + + /// + /// Check if two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're equal, false otherwise. + public static bool operator ==(AccountSasResourceTypes left, AccountSasResourceTypes right) => + left.Equals(right); + + /// + /// Check if two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're not equal, false otherwise. + public static bool operator !=(AccountSasResourceTypes left, AccountSasResourceTypes right) => + !(left == right); + /// /// Parse a string representing which resource types are accessible /// from a shared access signature. @@ -86,21 +114,27 @@ internal static string ToPermissionsString(this AccountSasResourceTypes resource /// /// An instance. /// - internal static AccountSasResourceTypes ParseResourceTypes(string s) + public static AccountSasResourceTypes Parse(string s) { - AccountSasResourceTypes types = default; + var types = new AccountSasResourceTypes(); foreach (var ch in s) { - types |= ch switch + switch (ch) { - Constants.Sas.AccountResources.Service => AccountSasResourceTypes.Service, - Constants.Sas.AccountResources.Container => AccountSasResourceTypes.Container, - Constants.Sas.AccountResources.Object => AccountSasResourceTypes.Object, - _ => throw Errors.InvalidResourceType(ch), - }; + case Constants.Sas.AccountResources.Service: + types.Service = true; + break; + case Constants.Sas.AccountResources.BlobContainer: + types.BlobContainer = true; + break; + case Constants.Sas.AccountResources.Object: + types.Object = true; + break; + default: + throw Errors.InvalidResourceType(ch); + } } return types; } - } } diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasServices.cs b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasServices.cs index af15b5dccb1b..2c110aa2301a 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasServices.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasServices.cs @@ -2,47 +2,36 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; using System.Text; namespace Azure.Storage.Sas { /// /// Specifies the services accessible from an account level shared access - /// signature. + /// signature. Use to produce a value that can be + /// used for . /// - [Flags] - public enum AccountSasServices + public struct AccountSasServices : IEquatable { /// - /// Indicates whether Azure Blob Storage resources are + /// Gets a value indicating whether Azure Blob Storage resources are /// accessible from the shared access signature. /// - Blobs = 1, + public bool Blobs { get; set; } /// - /// Indicates whether Azure Queue Storage resources are + /// Gets a value indicating whether Azure Queue Storage resources are /// accessible from the shared access signature. /// - Queues = 2, + public bool Queues { get; set; } /// - /// Indicates whether Azure File Storage resources are + /// Gets a value indicating whether Azure File Storage resources are /// accessible from the shared access signature. /// - Files = 4, + public bool Files { get; set; } - /// - /// Indicates all services are accessible from the shared - /// access signature. - /// - All = ~0 - } - - /// - /// Extension methods for AccountSasServices enum - /// - internal static partial class SasExtensions - { /// /// Creates a string representing which services can be used for /// . @@ -50,24 +39,66 @@ internal static partial class SasExtensions /// /// A string representing which services are allowed. /// - internal static string ToPermissionsString(this AccountSasServices services) + public override string ToString() { var sb = new StringBuilder(); - if ((services & AccountSasServices.Blobs) == AccountSasServices.Blobs) - { - sb.Append(Constants.Sas.AccountServices.Blob); - } - if ((services & AccountSasServices.Queues) == AccountSasServices.Queues) - { - sb.Append(Constants.Sas.AccountServices.Queue); - } - if ((services & AccountSasServices.Files) == AccountSasServices.Files) - { - sb.Append(Constants.Sas.AccountServices.File); - } + if (Blobs) { sb.Append(Constants.Sas.AccountServices.Blob); } + if (Queues) { sb.Append(Constants.Sas.AccountServices.Queue); } + if (Files) { sb.Append(Constants.Sas.AccountServices.File); } return sb.ToString(); } + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => + obj is AccountSasServices other && + Equals(other); + + /// + /// Get a hash code for the . + /// + /// + /// Hash code for the . + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => + (Blobs ? 0b001 : 0) + + (Queues ? 0b010 : 0) + + (Files ? 0b100 : 0); + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + public bool Equals(AccountSasServices other) => + other.Blobs == Blobs && + other.Queues == Queues && + other.Files == Files; + + /// + /// Check if two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're equal, false otherwise. + public static bool operator ==(AccountSasServices left, AccountSasServices right) => + left.Equals(right); + + /// + /// Check if two instances are not + /// equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're not equal, false otherwise. + public static bool operator !=(AccountSasServices left, AccountSasServices right) => + !(left == right); + /// /// Parse a string representing which services are accessible from a /// shared access signature. @@ -78,18 +109,25 @@ internal static string ToPermissionsString(this AccountSasServices services) /// /// An instance. /// - internal static AccountSasServices ParseAccountServices(string s) + public static AccountSasServices Parse(string s) { - AccountSasServices svcs = default; + var svcs = new AccountSasServices(); foreach (var ch in s) { - svcs |= ch switch + switch (ch) { - Constants.Sas.AccountServices.Blob => AccountSasServices.Blobs, - Constants.Sas.AccountServices.Queue => AccountSasServices.Queues, - Constants.Sas.AccountServices.File => AccountSasServices.Files, - _ => throw Errors.InvalidService(ch), - }; + case Constants.Sas.AccountServices.Blob: + svcs.Blobs = true; + break; + case Constants.Sas.AccountServices.Queue: + svcs.Queues = true; + break; + case Constants.Sas.AccountServices.File: + svcs.Files = true; + break; + default: + throw Errors.InvalidService(ch); + } } return svcs; } diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/SasProtocol.cs b/sdk/storage/Azure.Storage.Common/src/Sas/SasProtocol.cs index 4961c12b2869..4862b3b4e5ea 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/SasProtocol.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/SasProtocol.cs @@ -1,73 +1,115 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using System.ComponentModel; + namespace Azure.Storage.Sas { /// /// Defines the protocols permitted for Storage requests made with a shared /// access signature. /// - public enum SasProtocol + public readonly struct SasProtocol : IEquatable { + private const string NoneName = null; + private const string HttpsName = "https"; + private const string HttpsAndHttpName = "https,http"; + /// - /// No protocol has been specified. If no value is specified, - /// the service will default to HttpsAndHttp. + /// No protocol has been specified. /// - None = 0, + public static SasProtocol None => new SasProtocol(NoneName); + /// - /// Only requests issued over HTTPS or HTTP will be permitted. + /// Only requests issued over HTTPS will be permitted. /// - HttpsAndHttp = 1, + public static SasProtocol Https => new SasProtocol(HttpsName); /// - /// Only requests issued over HTTPS will be permitted. + /// Only requests issued over HTTPS or HTTP will be permitted. This is + /// the default value. /// - Https = 2 - } + public static SasProtocol HttpsAndHttp => new SasProtocol(HttpsAndHttpName); - /// - /// Extension methods for AccountSasResourceTypes enum - /// - internal static partial class SasExtensions - { - private const string NoneName = null; - private const string HttpsName = "https"; - private const string HttpsAndHttpName = "https,http"; + /// + /// Gets the name of the protocol. + /// + public string Value { get; } + + /// + /// Creates a new instance of the type. + /// + /// A string representation of the protocol. + private SasProtocol(string name) => + Value = name; /// /// Gets a string representation of the protocol. /// /// A string representation of the protocol. - internal static string ToProtocolString(this SasProtocol protocol) - { - switch (protocol) - { - case SasProtocol.Https: - return HttpsName; - case SasProtocol.HttpsAndHttp: - return HttpsAndHttpName; - case SasProtocol.None: - default: - return null; - } - } + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ToString() => + Value ?? ""; + + /// + /// Check if two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're equal, false otherwise. + public static bool operator ==(SasProtocol o1, SasProtocol o2) => + o1.Value == o2.Value; + + /// + /// Check if two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// True if they're not equal, false otherwise. + public static bool operator !=(SasProtocol o1, SasProtocol o2) => + o1.Value != o2.Value; + + /// + /// Get a hash code for the . + /// + /// Hash code for the . + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => + Value?.GetHashCode() ?? 0; + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SasProtocol other && Equals(other); + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + public bool Equals(SasProtocol other) + => Value == other.Value; /// /// Parse a string representation of a protocol. /// /// A string representation of a protocol. /// A . - public static SasProtocol ParseProtocol(string s) + public static SasProtocol Parse(string s) { switch (s) { - case NoneName: + case null: case "": - return SasProtocol.None; + return None; case HttpsName: - return SasProtocol.Https; + return Https; case HttpsAndHttpName: - return SasProtocol.HttpsAndHttp; + return HttpsAndHttp; default: throw Errors.InvalidSasProtocol(nameof(s), nameof(SasProtocol)); } diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs b/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs index a574ed4d167b..83dbc4762859 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs @@ -41,10 +41,10 @@ internal static string FormatTimesForSasSigning(DateTimeOffset time) => private readonly string _version; // ss - private readonly AccountSasServices? _services; + private readonly string _services; // srt - private readonly AccountSasResourceTypes? _resourceTypes; + private readonly string _resourceTypes; // spr private readonly SasProtocol _protocol; @@ -96,12 +96,12 @@ internal static string FormatTimesForSasSigning(DateTimeOffset time) => /// Gets the signed services accessible with an account level shared /// access signature. /// - public AccountSasServices? Services => _services; + public string Services => _services ?? string.Empty; /// /// Gets which resources are accessible via the shared access signature. /// - public AccountSasResourceTypes? ResourceTypes => _resourceTypes; + public string ResourceTypes => _resourceTypes ?? string.Empty; /// /// Optional. Specifies the protocol permitted for a request made with @@ -223,8 +223,8 @@ internal SasQueryParameters() { } /// internal SasQueryParameters( string version, - AccountSasServices? services, - AccountSasResourceTypes? resourceTypes, + string services, + string resourceTypes, SasProtocol protocol, DateTimeOffset startTime, DateTimeOffset expiryTime, @@ -247,8 +247,8 @@ internal SasQueryParameters( { // Assume URL-decoded _version = version ?? DefaultSasVersion; - _services = services; - _resourceTypes = resourceTypes; + _services = services ?? string.Empty; + _resourceTypes = resourceTypes ?? string.Empty; _protocol = protocol; _startTime = startTime; _expiryTime = expiryTime; @@ -297,13 +297,13 @@ internal SasQueryParameters( _version = kv.Value; break; case Constants.Sas.Parameters.ServicesUpper: - _services = SasExtensions.ParseAccountServices(kv.Value); + _services = kv.Value; break; case Constants.Sas.Parameters.ResourceTypesUpper: - _resourceTypes = SasExtensions.ParseResourceTypes(kv.Value); + _resourceTypes = kv.Value; break; case Constants.Sas.Parameters.ProtocolUpper: - _protocol = SasExtensions.ParseProtocol(kv.Value); + _protocol = SasProtocol.Parse(kv.Value); break; case Constants.Sas.Parameters.StartTimeUpper: _startTime = DateTimeOffset.ParseExact(kv.Value, Constants.SasTimeFormat, CultureInfo.InvariantCulture); @@ -418,19 +418,19 @@ void AddToBuilder(string key, string value) AddToBuilder(Constants.Sas.Parameters.Version, Version); } - if (Services != null) + if (!string.IsNullOrWhiteSpace(Services)) { - AddToBuilder(Constants.Sas.Parameters.Services, Services.Value.ToPermissionsString()); + AddToBuilder(Constants.Sas.Parameters.Services, Services); } - if (ResourceTypes != null) + if (!string.IsNullOrWhiteSpace(ResourceTypes)) { - AddToBuilder(Constants.Sas.Parameters.ResourceTypes, ResourceTypes.Value.ToPermissionsString()); + AddToBuilder(Constants.Sas.Parameters.ResourceTypes, ResourceTypes); } - if (Protocol != default) + if (Protocol != SasProtocol.None) { - AddToBuilder(Constants.Sas.Parameters.Protocol, Protocol.ToProtocolString()); + AddToBuilder(Constants.Sas.Parameters.Protocol, Protocol.ToString()); } if (StartTime != DateTimeOffset.MinValue) diff --git a/sdk/storage/Azure.Storage.Files/samples/Sample02_Auth.cs b/sdk/storage/Azure.Storage.Files/samples/Sample02_Auth.cs index 6d1f81667d36..e836e19c812f 100644 --- a/sdk/storage/Azure.Storage.Files/samples/Sample02_Auth.cs +++ b/sdk/storage/Azure.Storage.Files/samples/Sample02_Auth.cs @@ -102,10 +102,10 @@ public async Task SharedAccessSignatureAuthAsync() AccountSasBuilder sas = new AccountSasBuilder { // Allow access to files - Services = AccountSasServices.Files, + Services = new AccountSasServices() { Files = true }.ToString(), // Allow access to the service level APIs - ResourceTypes = AccountSasResourceTypes.Service, + ResourceTypes = new AccountSasResourceTypes() { Service = true }.ToString(), // Allow read access Permissions = new AccountSasPermissions() { Read = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs b/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs index d2ebf02a6596..4bac34c81425 100644 --- a/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs @@ -164,8 +164,8 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared var p = new SasQueryParameters( version: Version, - services: default, - resourceTypes: default, + services: null, + resourceTypes: null, protocol: Protocol, startTime: StartTime, expiryTime: ExpiryTime, diff --git a/sdk/storage/Azure.Storage.Files/tests/FileSasBuilderTests.cs b/sdk/storage/Azure.Storage.Files/tests/FileSasBuilderTests.cs index 602021b50c3c..68767616386e 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileSasBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileSasBuilderTests.cs @@ -33,8 +33,8 @@ public void FileSasBuilder_ToSasQueryParameters_FilePathTest() // Assert Assert.AreEqual(constants.Sas.Version, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(string.Empty, sasQueryParameters.Services); + Assert.AreEqual(string.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -61,8 +61,8 @@ public void FileSasBuilder_ToSasQueryParameters_NoVersionTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(string.Empty, sasQueryParameters.Services); + Assert.AreEqual(string.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(constants.Sas.Protocol, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); diff --git a/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs b/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs index 8bc4817fef95..0c1050aa2c32 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs @@ -126,8 +126,8 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential => new AccountSasBuilder { Protocol = SasProtocol.None, - Services = AccountSasServices.Files, - ResourceTypes = AccountSasResourceTypes.Container, + Services = new AccountSasServices { Files = true }.ToString(), + ResourceTypes = new AccountSasResourceTypes { BlobContainer = true }.ToString(), StartTime = Recording.UtcNow.AddHours(-1), ExpiryTime = Recording.UtcNow.AddHours(+1), Permissions = new FileAccountSasPermissions { Create = true, Delete = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs b/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs index 5a8a6474d76e..70fb63d24b19 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs @@ -164,8 +164,8 @@ public void FileUriBuilder_SasTest() Assert.AreEqual("rw", fileUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, fileUriBuilder.Sas.Protocol); Assert.AreEqual("b", fileUriBuilder.Sas.Resource); - Assert.IsNull(fileUriBuilder.Sas.ResourceTypes); - Assert.IsNull(fileUriBuilder.Sas.Services); + Assert.AreEqual("", fileUriBuilder.Sas.ResourceTypes); + Assert.AreEqual("", fileUriBuilder.Sas.Services); Assert.AreEqual("Z/RHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk=", fileUriBuilder.Sas.Signature); Assert.AreEqual(new DateTimeOffset(2015, 4, 29, 22, 18, 26, TimeSpan.Zero), fileUriBuilder.Sas.StartTime); Assert.AreEqual("2015-04-05", fileUriBuilder.Sas.Version); diff --git a/sdk/storage/Azure.Storage.Queues/samples/Sample02_Auth.cs b/sdk/storage/Azure.Storage.Queues/samples/Sample02_Auth.cs index e38b0ffe9737..bea375def3a1 100644 --- a/sdk/storage/Azure.Storage.Queues/samples/Sample02_Auth.cs +++ b/sdk/storage/Azure.Storage.Queues/samples/Sample02_Auth.cs @@ -102,10 +102,10 @@ public async Task SharedAccessSignatureAuthAsync() AccountSasBuilder sas = new AccountSasBuilder { // Allow access to queues - Services = AccountSasServices.Queues, + Services = new AccountSasServices() { Queues = true }.ToString(), // Allow access to the service level APIs - ResourceTypes = AccountSasResourceTypes.Service, + ResourceTypes = new AccountSasResourceTypes() { Service = true }.ToString(), // Allow read access Permissions = new AccountSasPermissions() { Read = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs b/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs index 48f56440498e..64f32748fcd4 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs @@ -113,8 +113,8 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared var signature = sharedKeyCredential.ComputeHMACSHA256(stringToSign); var p = new SasQueryParameters( version: Version, - services: default, - resourceTypes: default, + services: null, + resourceTypes: null, protocol: Protocol, startTime: StartTime, expiryTime: ExpiryTime, diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueSasBuilderTests.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueSasBuilderTests.cs index 6aa5b53a0c6f..b38e5ff01b8c 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueSasBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueSasBuilderTests.cs @@ -32,8 +32,8 @@ public void QueueSasBuilder_ToSasQueryParameters_VersionTest() // Assert Assert.AreEqual(constants.Sas.Version, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(string.Empty, sasQueryParameters.Services); + Assert.AreEqual(string.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(SasProtocol.Https, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); @@ -58,8 +58,8 @@ public void QueueSasBuilder_ToSasQueryParameters_NoVersionTest() // Assert Assert.AreEqual(SasQueryParameters.DefaultSasVersion, sasQueryParameters.Version); - Assert.IsNull(sasQueryParameters.Services); - Assert.IsNull(sasQueryParameters.ResourceTypes); + Assert.AreEqual(string.Empty, sasQueryParameters.Services); + Assert.AreEqual(string.Empty, sasQueryParameters.ResourceTypes); Assert.AreEqual(SasProtocol.Https, sasQueryParameters.Protocol); Assert.AreEqual(constants.Sas.StartTime, sasQueryParameters.StartTime); Assert.AreEqual(constants.Sas.ExpiryTime, sasQueryParameters.ExpiryTime); diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs index 92ed6608dc36..104c60584e6d 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs @@ -139,8 +139,8 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential => new AccountSasBuilder { Protocol = SasProtocol.None, - Services = AccountSasServices.Queues, - ResourceTypes = AccountSasResourceTypes.Container, + Services = new AccountSasServices { Queues = true }.ToString(), + ResourceTypes = new AccountSasResourceTypes { BlobContainer = true }.ToString(), StartTime = Recording.UtcNow.AddHours(-1), ExpiryTime = Recording.UtcNow.AddHours(+1), Permissions = new QueueAccountSasPermissions { Read = true, Write = true, Update = true, Process = true, Add = true, Delete = true, List = true }.ToString(), diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs index b6f2d1bb9e56..d32f94a71cbe 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs @@ -166,8 +166,8 @@ public void QueueUriBuilder_RegularUrl_SasTest() Assert.AreEqual("rw", queueUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, queueUriBuilder.Sas.Protocol); Assert.AreEqual("b", queueUriBuilder.Sas.Resource); - Assert.IsNull(queueUriBuilder.Sas.ResourceTypes); - Assert.IsNull(queueUriBuilder.Sas.Services); + Assert.AreEqual("", queueUriBuilder.Sas.ResourceTypes); + Assert.AreEqual("", queueUriBuilder.Sas.Services); Assert.AreEqual("Z/RHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk=", queueUriBuilder.Sas.Signature); Assert.AreEqual(new DateTimeOffset(2015, 4, 29, 22, 18, 26, TimeSpan.Zero), queueUriBuilder.Sas.StartTime); Assert.AreEqual("2015-04-05", queueUriBuilder.Sas.Version); @@ -353,8 +353,8 @@ public void QueueUriBuilder_IPStyleUrl_SasTest() Assert.AreEqual("rw", queueUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, queueUriBuilder.Sas.Protocol); Assert.AreEqual("b", queueUriBuilder.Sas.Resource); - Assert.IsNull(queueUriBuilder.Sas.ResourceTypes); - Assert.IsNull(queueUriBuilder.Sas.Services); + Assert.AreEqual("", queueUriBuilder.Sas.ResourceTypes); + Assert.AreEqual("", queueUriBuilder.Sas.Services); Assert.AreEqual("Z/RHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk=", queueUriBuilder.Sas.Signature); Assert.AreEqual(new DateTimeOffset(2015, 4, 29, 22, 18, 26, TimeSpan.Zero), queueUriBuilder.Sas.StartTime); Assert.AreEqual("2015-04-05", queueUriBuilder.Sas.Version);