-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use property reference type (#37542)
* Use property reference type * docs * Add ctor attributes * Make discriminator property public * remove attribute args * Try referenceType * Revert attribute changes and add model factory * Add ref docs
- Loading branch information
1 parent
87948f2
commit cdd538e
Showing
9 changed files
with
99 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryModelFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Azure.Core.Expressions.DataFactory | ||
{ | ||
/// <summary> | ||
/// Model factory to construct types for mocking. | ||
/// </summary> | ||
public static class DataFactoryModelFactory | ||
{ | ||
/// <summary> | ||
/// Constructs a <see cref="DataFactorySecretString"/> for mocking. | ||
/// </summary> | ||
/// <param name="value">The secret string value.</param> | ||
/// <returns>The constructed <see cref="DataFactorySecretString"/>.</returns> | ||
public static DataFactorySecretString DataFactorySecretString(string value) => | ||
new DataFactorySecretString(value); | ||
|
||
/// <summary> | ||
/// Constructs a <see cref="DataFactoryKeyVaultSecretReference"/> for mocking. | ||
/// </summary> | ||
/// <param name="store">The linked store.</param> | ||
/// <param name="secretName">The secret name.</param> | ||
/// <param name="secretVersion">The secret version.</param> | ||
/// <returns>The constructed <see cref="DataFactoryKeyVaultSecretReference"/>.</returns> | ||
public static DataFactoryKeyVaultSecretReference DataFactoryKeyVaultSecretReference( | ||
DataFactoryLinkedServiceReference store, | ||
DataFactoryElement<string> secretName, | ||
DataFactoryElement<string> secretVersion) => | ||
new DataFactoryKeyVaultSecretReference(store, secretName) { SecretVersion = secretVersion }; | ||
|
||
/// <summary> | ||
/// Constructs a <see cref="DataFactorySecretBaseDefinition"/> for mocking. | ||
/// </summary> | ||
/// <param name="secretBaseType">The secret base type.</param> | ||
/// <returns>The constructed <see cref="DataFactorySecretBaseDefinition"/>.</returns> | ||
public static DataFactorySecretBaseDefinition DataFactorySecretBaseDefinition(string secretBaseType) => | ||
new UnknownSecretBase(secretBaseType); | ||
|
||
/// <summary> | ||
/// Constructs a <see cref="DataFactoryLinkedServiceReference"/> for mocking. | ||
/// </summary> | ||
/// <param name="referenceType">The reference type.</param> | ||
/// <param name="referenceName">The reference name.</param> | ||
/// <param name="parameters">The reference parameters.</param> | ||
/// <returns>The constructed <see cref="DataFactoryLinkedServiceReference"/>.</returns> | ||
public static DataFactoryLinkedServiceReference DataFactoryLinkedServiceReference( | ||
DataFactoryLinkedServiceReferenceType referenceType, | ||
string? referenceName, | ||
IDictionary<string, BinaryData?> parameters) => | ||
new DataFactoryLinkedServiceReference(referenceType, referenceName, parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters