internal ManagedStorageSasDefinition(Azure.KeyVault.Models.SasDefinitionBundle storageSasDefinitionBundle, VaultUriHelper vaultUriHelper) { if (storageSasDefinitionBundle == null) { throw new ArgumentNullException("storageSasDefinitionBundle"); } if (vaultUriHelper == null) { throw new ArgumentNullException("vaultUriHelper"); } var identifier = new SasDefinitionIdentifier(storageSasDefinitionBundle.Id); Id = identifier.Identifier; VaultName = vaultUriHelper.GetVaultName(identifier.Identifier); Name = identifier.Name; Attributes = storageSasDefinitionBundle.Attributes == null ? null : new ManagedStorageSasDefinitionAttributes(storageSasDefinitionBundle.Attributes.Enabled, storageSasDefinitionBundle.Attributes.Created, storageSasDefinitionBundle.Attributes.Updated); Tags = storageSasDefinitionBundle.Tags == null ? null : storageSasDefinitionBundle.Tags.ConvertToHashtable(); Sid = storageSasDefinitionBundle.SecretId; Parameter = storageSasDefinitionBundle.Parameters == null ? null : storageSasDefinitionBundle.Parameters.ConvertToHashtable(); AccountName = identifier.StorageAccount; }
internal PSKeyVaultManagedStorageSasDefinition(Azure.KeyVault.Models.SasDefinitionBundle storageSasDefinitionBundle, VaultUriHelper vaultUriHelper) { if (storageSasDefinitionBundle == null) { throw new ArgumentNullException(nameof(storageSasDefinitionBundle)); } if (vaultUriHelper == null) { throw new ArgumentNullException(nameof(vaultUriHelper)); } var identifier = new SasDefinitionIdentifier(storageSasDefinitionBundle.Id); SetObjectIdentifier(vaultUriHelper, identifier); Attributes = storageSasDefinitionBundle.Attributes == null ? null : new PSKeyVaultManagedStorageSasDefinitionAttributes(storageSasDefinitionBundle.Attributes); Tags = storageSasDefinitionBundle.Tags == null ? null : storageSasDefinitionBundle.Tags.ConvertToHashtable(); Sid = storageSasDefinitionBundle.SecretId; TemplateUri = storageSasDefinitionBundle.TemplateUri; SasType = storageSasDefinitionBundle.SasType; ValidityPeriod = storageSasDefinitionBundle.ValidityPeriod; AccountName = identifier.StorageAccount; }