From a675d41db3367eed7be31f4e09e075dc4921e5dc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 Jul 2023 03:39:04 +0000 Subject: [PATCH] CodeGen from PR 24709 in Azure/azure-rest-api-specs Merge 420f8cd37fdff197521fa1c1b84855cc24495c64 into 26cac4f70e9ce0e1c2f77de8303b47d1faa9ad33 --- ...ourceManager.DataFactory.netstandard2.0.cs | 225 +++++- .../Generated/ChangeDataCaptureResource.cs | 481 ++++++++++++ .../ChangeDataCaptureResourceCollection.cs | 346 +++++++++ .../ChangeDataCaptureResourceData.cs | 128 ++++ .../src/Generated/DataFactoryResource.cs | 55 ++ .../Extensions/DataFactoryExtensions.cs | 19 + ...ureMLServiceLinkedService.Serialization.cs | 17 +- .../Models/AzureMLServiceLinkedService.cs | 6 +- .../ChangeDataCaptureFolder.Serialization.cs | 44 ++ .../Models/ChangeDataCaptureFolder.cs | 28 + ...geDataCaptureListResponse.Serialization.cs | 46 ++ .../Models/ChangeDataCaptureListResponse.cs | 43 ++ ...geDataCaptureResourceData.Serialization.cs | 200 +++++ .../src/Generated/Models/ConnectionType.cs | 48 ++ .../Models/DataMapperMapping.Serialization.cs | 105 +++ .../src/Generated/Models/DataMapperMapping.cs | 87 +++ .../src/Generated/Models/FrequencyType.cs | 54 ++ .../MapperAttributeMapping.Serialization.cs | 122 +++ .../Models/MapperAttributeMapping.cs | 52 ++ .../MapperAttributeMappings.Serialization.cs | 59 ++ .../Models/MapperAttributeMappings.cs | 32 + .../MapperAttributeReference.Serialization.cs | 70 ++ .../Models/MapperAttributeReference.cs | 36 + .../Models/MapperConnection.Serialization.cs | 108 +++ .../src/Generated/Models/MapperConnection.cs | 50 ++ ...MapperConnectionReference.Serialization.cs | 59 ++ .../Models/MapperConnectionReference.cs | 32 + ...perDslConnectorProperties.Serialization.cs | 64 ++ .../Models/MapperDslConnectorProperties.cs | 63 ++ .../Models/MapperPolicy.Serialization.cs | 59 ++ .../src/Generated/Models/MapperPolicy.cs | 32 + .../MapperPolicyRecurrence.Serialization.cs | 63 ++ .../Models/MapperPolicyRecurrence.cs | 32 + ...pperSourceConnectionsInfo.Serialization.cs | 74 ++ .../Models/MapperSourceConnectionsInfo.cs | 36 + .../Models/MapperTable.Serialization.cs | 110 +++ .../src/Generated/Models/MapperTable.cs | 41 + .../Models/MapperTableSchema.Serialization.cs | 55 ++ .../src/Generated/Models/MapperTableSchema.cs | 32 + ...pperTargetConnectionsInfo.Serialization.cs | 141 ++++ .../Models/MapperTargetConnectionsInfo.cs | 76 ++ .../src/Generated/Models/MappingType.cs | 54 ++ ...MongoDBAtlasLinkedService.Serialization.cs | 14 +- .../Models/MongoDBAtlasLinkedService.cs | 10 +- ...esforceServiceCloudSource.Serialization.cs | 8 +- .../Models/SalesforceServiceCloudSource.cs | 8 +- .../Models/SalesforceSource.Serialization.cs | 8 +- .../src/Generated/Models/SalesforceSource.cs | 8 +- .../Models/SalesforceSourceReadBehavior.cs | 51 -- .../SecureInputOutputPolicy.Serialization.cs | 63 ++ .../Models/SecureInputOutputPolicy.cs | 32 + .../SetVariableActivity.Serialization.cs | 17 +- .../Generated/Models/SetVariableActivity.cs | 6 +- .../ChangeDataCaptureRestOperations.cs | 698 ++++++++++++++++++ .../src/autorest.md | 2 +- 55 files changed, 4304 insertions(+), 105 deletions(-) create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResource.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceCollection.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceData.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureResourceData.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ConnectionType.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/FrequencyType.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MappingType.cs delete mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSourceReadBehavior.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.Serialization.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.cs create mode 100644 sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/RestOperations/ChangeDataCaptureRestOperations.cs diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs index e5ca6e5e72e7..74672f4ad686 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs @@ -1,5 +1,53 @@ namespace Azure.ResourceManager.DataFactory { + public partial class ChangeDataCaptureResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ChangeDataCaptureResource() { } + public virtual Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Start(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Status(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> StatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Stop(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceData data, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceData data, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ChangeDataCaptureResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ChangeDataCaptureResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string changeDataCaptureName, Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceData data, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string changeDataCaptureName, Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceData data, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ChangeDataCaptureResourceData : Azure.ResourceManager.Models.ResourceData + { + public ChangeDataCaptureResourceData(System.Collections.Generic.IEnumerable sourceConnectionsInfo, System.Collections.Generic.IEnumerable targetConnectionsInfo, Azure.ResourceManager.DataFactory.Models.MapperPolicy policy) { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + public bool? AllowVNetOverride { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ETag? ETag { get { throw null; } } + public string FolderName { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.MapperPolicy Policy { get { throw null; } set { } } + public System.Collections.Generic.IList SourceConnectionsInfo { get { throw null; } } + public string Status { get { throw null; } set { } } + public System.Collections.Generic.IList TargetConnectionsInfo { get { throw null; } } + } public partial class DataFactoryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected DataFactoryCollection() { } @@ -104,6 +152,7 @@ public static partial class DataFactoryExtensions { public static Azure.Response ConfigureFactoryRepoInformation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationId, Azure.ResourceManager.DataFactory.Models.FactoryRepoUpdate factoryRepoUpdate, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> ConfigureFactoryRepoInformationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation locationId, Azure.ResourceManager.DataFactory.Models.FactoryRepoUpdate factoryRepoUpdate, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DataFactory.ChangeDataCaptureResource GetChangeDataCaptureResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DataFactory.DataFactoryCollection GetDataFactories(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetDataFactories(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDataFactoriesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -477,6 +526,9 @@ protected DataFactoryResource() { } public virtual Azure.Pageable GetActivityRun(string runId, Azure.ResourceManager.DataFactory.Models.RunFilterContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetActivityRunAsync(string runId, Azure.ResourceManager.DataFactory.Models.RunFilterContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetChangeDataCaptureResource(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetChangeDataCaptureResourceAsync(string changeDataCaptureName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DataFactory.ChangeDataCaptureResourceCollection GetChangeDataCaptureResources() { throw null; } public virtual Azure.Response GetDataFactoryDataFlow(string dataFlowName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDataFactoryDataFlowAsync(string dataFlowName, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DataFactory.DataFactoryDataFlowCollection GetDataFactoryDataFlows() { throw null; } @@ -1304,6 +1356,7 @@ public AzureMLLinkedService(Azure.Core.Expressions.DataFactory.DataFactoryElemen public partial class AzureMLServiceLinkedService : Azure.ResourceManager.DataFactory.Models.DataFactoryLinkedServiceDefinition { public AzureMLServiceLinkedService(Azure.Core.Expressions.DataFactory.DataFactoryElement subscriptionId, Azure.Core.Expressions.DataFactory.DataFactoryElement resourceGroupName, Azure.Core.Expressions.DataFactory.DataFactoryElement mlWorkspaceName) { } + public Azure.Core.Expressions.DataFactory.DataFactoryElement Authentication { get { throw null; } set { } } public System.BinaryData EncryptedCredential { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement MlWorkspaceName { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement ResourceGroupName { get { throw null; } set { } } @@ -1759,6 +1812,23 @@ public ConnectionStateProperties() { } public string Description { get { throw null; } } public string Status { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionType(string value) { throw null; } + public static Azure.ResourceManager.DataFactory.Models.ConnectionType Linkedservicetype { get { throw null; } } + public bool Equals(Azure.ResourceManager.DataFactory.Models.ConnectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DataFactory.Models.ConnectionType left, Azure.ResourceManager.DataFactory.Models.ConnectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.DataFactory.Models.ConnectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DataFactory.Models.ConnectionType left, Azure.ResourceManager.DataFactory.Models.ConnectionType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ControlActivity : Azure.ResourceManager.DataFactory.Models.DataFactoryActivity { public ControlActivity(string name) : base (default(string)) { } @@ -2710,6 +2780,15 @@ public DataLakeAnalyticsUsqlActivity(string name, Azure.Core.Expressions.DataFac public Azure.ResourceManager.DataFactory.Models.DataFactoryLinkedServiceReference ScriptLinkedService { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement ScriptPath { get { throw null; } set { } } } + public partial class DataMapperMapping + { + public DataMapperMapping() { } + public System.Collections.Generic.IList AttributeMappings { get { throw null; } } + public Azure.ResourceManager.DataFactory.Models.MapperConnectionReference SourceConnectionReference { get { throw null; } set { } } + public System.BinaryData SourceDenormalizeInfo { get { throw null; } set { } } + public string SourceEntityName { get { throw null; } set { } } + public string TargetEntityName { get { throw null; } set { } } + } public partial class DatasetAvroFormat : Azure.ResourceManager.DataFactory.Models.DatasetStorageFormat { public DatasetAvroFormat() { } @@ -3412,6 +3491,25 @@ public FormatWriteSettings() { } public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FrequencyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FrequencyType(string value) { throw null; } + public static Azure.ResourceManager.DataFactory.Models.FrequencyType Hour { get { throw null; } } + public static Azure.ResourceManager.DataFactory.Models.FrequencyType Minute { get { throw null; } } + public static Azure.ResourceManager.DataFactory.Models.FrequencyType Second { get { throw null; } } + public bool Equals(Azure.ResourceManager.DataFactory.Models.FrequencyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DataFactory.Models.FrequencyType left, Azure.ResourceManager.DataFactory.Models.FrequencyType right) { throw null; } + public static implicit operator Azure.ResourceManager.DataFactory.Models.FrequencyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DataFactory.Models.FrequencyType left, Azure.ResourceManager.DataFactory.Models.FrequencyType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct FtpAuthenticationType : System.IEquatable { private readonly object _dummy; @@ -4662,6 +4760,102 @@ public ManagedVirtualNetworkReference(Azure.ResourceManager.DataFactory.Models.M public static bool operator !=(Azure.ResourceManager.DataFactory.Models.ManagedVirtualNetworkReferenceType left, Azure.ResourceManager.DataFactory.Models.ManagedVirtualNetworkReferenceType right) { throw null; } public override string ToString() { throw null; } } + public partial class MapperAttributeMapping + { + public MapperAttributeMapping() { } + public Azure.ResourceManager.DataFactory.Models.MapperAttributeReference AttributeReference { get { throw null; } set { } } + public System.Collections.Generic.IList AttributeReferences { get { throw null; } } + public string Expression { get { throw null; } set { } } + public string FunctionName { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.MappingType? MappingType { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + } + public partial class MapperAttributeReference + { + public MapperAttributeReference() { } + public string Entity { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.MapperConnectionReference EntityConnectionReference { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + } + public partial class MapperConnection + { + public MapperConnection(Azure.ResourceManager.DataFactory.Models.ConnectionType connectionType) { } + public System.Collections.Generic.IList CommonDslConnectorProperties { get { throw null; } } + public Azure.ResourceManager.DataFactory.Models.ConnectionType ConnectionType { get { throw null; } set { } } + public bool? IsInlineDataset { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.DataFactoryLinkedServiceReference LinkedService { get { throw null; } set { } } + public string LinkedServiceType { get { throw null; } set { } } + } + public partial class MapperConnectionReference + { + public MapperConnectionReference() { } + public string ConnectionName { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.ConnectionType? ConnectionType { get { throw null; } set { } } + } + public partial class MapperDslConnectorProperties + { + public MapperDslConnectorProperties() { } + public string Name { get { throw null; } set { } } + public System.BinaryData Value { get { throw null; } set { } } + } + public partial class MapperPolicy + { + public MapperPolicy() { } + public string Mode { get { throw null; } set { } } + public Azure.ResourceManager.DataFactory.Models.MapperPolicyRecurrence Recurrence { get { throw null; } set { } } + } + public partial class MapperPolicyRecurrence + { + public MapperPolicyRecurrence() { } + public Azure.ResourceManager.DataFactory.Models.FrequencyType? Frequency { get { throw null; } set { } } + public int? Interval { get { throw null; } set { } } + } + public partial class MapperSourceConnectionsInfo + { + public MapperSourceConnectionsInfo() { } + public Azure.ResourceManager.DataFactory.Models.MapperConnection Connection { get { throw null; } set { } } + public System.Collections.Generic.IList SourceEntities { get { throw null; } } + } + public partial class MapperTable + { + public MapperTable() { } + public System.Collections.Generic.IList DslConnectorProperties { get { throw null; } } + public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList Schema { get { throw null; } } + } + public partial class MapperTableSchema + { + public MapperTableSchema() { } + public string DataType { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + } + public partial class MapperTargetConnectionsInfo + { + public MapperTargetConnectionsInfo() { } + public Azure.ResourceManager.DataFactory.Models.MapperConnection Connection { get { throw null; } set { } } + public System.Collections.Generic.IList DataMapperMappings { get { throw null; } } + public System.Collections.Generic.IList Relationships { get { throw null; } } + public System.Collections.Generic.IList TargetEntities { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MappingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MappingType(string value) { throw null; } + public static Azure.ResourceManager.DataFactory.Models.MappingType Aggregate { get { throw null; } } + public static Azure.ResourceManager.DataFactory.Models.MappingType Derived { get { throw null; } } + public static Azure.ResourceManager.DataFactory.Models.MappingType Direct { get { throw null; } } + public bool Equals(Azure.ResourceManager.DataFactory.Models.MappingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DataFactory.Models.MappingType left, Azure.ResourceManager.DataFactory.Models.MappingType right) { throw null; } + public static implicit operator Azure.ResourceManager.DataFactory.Models.MappingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DataFactory.Models.MappingType left, Azure.ResourceManager.DataFactory.Models.MappingType right) { throw null; } + public override string ToString() { throw null; } + } public partial class MariaDBLinkedService : Azure.ResourceManager.DataFactory.Models.DataFactoryLinkedServiceDefinition { public MariaDBLinkedService() { } @@ -4736,7 +4930,7 @@ public partial class MongoDBAtlasLinkedService : Azure.ResourceManager.DataFacto public MongoDBAtlasLinkedService(Azure.Core.Expressions.DataFactory.DataFactoryElement connectionString, Azure.Core.Expressions.DataFactory.DataFactoryElement database) { } public Azure.Core.Expressions.DataFactory.DataFactoryElement ConnectionString { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement Database { get { throw null; } set { } } - public Azure.Core.Expressions.DataFactory.DataFactoryElement MongoDBAtlasDriverVersion { get { throw null; } set { } } + public Azure.Core.Expressions.DataFactory.DataFactoryElement DriverVersion { get { throw null; } set { } } } public partial class MongoDBAtlasSink : Azure.ResourceManager.DataFactory.Models.CopySink { @@ -5784,7 +5978,7 @@ public partial class SalesforceServiceCloudSource : Azure.ResourceManager.DataFa public SalesforceServiceCloudSource() { } public System.BinaryData AdditionalColumns { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement Query { get { throw null; } set { } } - public Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior? ReadBehavior { get { throw null; } set { } } + public Azure.Core.Expressions.DataFactory.DataFactoryElement ReadBehavior { get { throw null; } set { } } } public partial class SalesforceSink : Azure.ResourceManager.DataFactory.Models.CopySink { @@ -5815,25 +6009,7 @@ public partial class SalesforceSource : Azure.ResourceManager.DataFactory.Models { public SalesforceSource() { } public Azure.Core.Expressions.DataFactory.DataFactoryElement Query { get { throw null; } set { } } - public Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior? ReadBehavior { get { throw null; } set { } } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct SalesforceSourceReadBehavior : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public SalesforceSourceReadBehavior(string value) { throw null; } - public static Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior Query { get { throw null; } } - public static Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior QueryAll { get { throw null; } } - public bool Equals(Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior left, Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior right) { throw null; } - public static implicit operator Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior left, Azure.ResourceManager.DataFactory.Models.SalesforceSourceReadBehavior right) { throw null; } - public override string ToString() { throw null; } + public Azure.Core.Expressions.DataFactory.DataFactoryElement ReadBehavior { get { throw null; } set { } } } public partial class SapBwCubeDataset : Azure.ResourceManager.DataFactory.Models.DataFactoryDatasetDefinition { @@ -6206,6 +6382,12 @@ public ScriptActivityTypePropertiesLogSettings(Azure.ResourceManager.DataFactory public static bool operator !=(Azure.ResourceManager.DataFactory.Models.ScriptType left, Azure.ResourceManager.DataFactory.Models.ScriptType right) { throw null; } public override string ToString() { throw null; } } + public partial class SecureInputOutputPolicy + { + public SecureInputOutputPolicy() { } + public bool? SecureInput { get { throw null; } set { } } + public bool? SecureOutput { get { throw null; } set { } } + } public partial class SelfDependencyTumblingWindowTriggerReference : Azure.ResourceManager.DataFactory.Models.DependencyReference { public SelfDependencyTumblingWindowTriggerReference(string offset) { } @@ -6335,6 +6517,7 @@ public ServicePrincipalCredential() { } public partial class SetVariableActivity : Azure.ResourceManager.DataFactory.Models.ControlActivity { public SetVariableActivity(string name) : base (default(string)) { } + public Azure.ResourceManager.DataFactory.Models.SecureInputOutputPolicy Policy { get { throw null; } set { } } public bool? SetSystemVariable { get { throw null; } set { } } public Azure.Core.Expressions.DataFactory.DataFactoryElement Value { get { throw null; } set { } } public string VariableName { get { throw null; } set { } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResource.cs new file mode 100644 index 000000000000..33bcede51bac --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResource.cs @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.DataFactory +{ + /// + /// A Class representing a ChangeDataCaptureResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetChangeDataCaptureResource method. + /// Otherwise you can get one from its parent resource using the GetChangeDataCaptureResource method. + /// + public partial class ChangeDataCaptureResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _changeDataCaptureResourceChangeDataCaptureClientDiagnostics; + private readonly ChangeDataCaptureRestOperations _changeDataCaptureResourceChangeDataCaptureRestClient; + private readonly ChangeDataCaptureResourceData _data; + + /// Initializes a new instance of the class for mocking. + protected ChangeDataCaptureResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ChangeDataCaptureResource(ArmClient client, ChangeDataCaptureResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ChangeDataCaptureResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _changeDataCaptureResourceChangeDataCaptureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DataFactory", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string changeDataCaptureResourceChangeDataCaptureApiVersion); + _changeDataCaptureResourceChangeDataCaptureRestClient = new ChangeDataCaptureRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, changeDataCaptureResourceChangeDataCaptureApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataFactory/factories/adfcdcs"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ChangeDataCaptureResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + public virtual async Task> GetAsync(string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Get"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifNoneMatch, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ChangeDataCaptureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + public virtual Response Get(string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Get"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifNoneMatch, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ChangeDataCaptureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Delete"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DataFactoryArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Delete"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DataFactoryArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Update"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DataFactoryArmOperation(Response.FromValue(new ChangeDataCaptureResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Update"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, cancellationToken); + var operation = new DataFactoryArmOperation(Response.FromValue(new ChangeDataCaptureResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/start + /// + /// + /// Operation Id + /// ChangeDataCapture_Start + /// + /// + /// + /// The cancellation token to use. + public virtual async Task StartAsync(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Start"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/start + /// + /// + /// Operation Id + /// ChangeDataCapture_Start + /// + /// + /// + /// The cancellation token to use. + public virtual Response Start(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Start"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/stop + /// + /// + /// Operation Id + /// ChangeDataCapture_Stop + /// + /// + /// + /// The cancellation token to use. + public virtual async Task StopAsync(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Stop"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/stop + /// + /// + /// Operation Id + /// ChangeDataCapture_Stop + /// + /// + /// + /// The cancellation token to use. + public virtual Response Stop(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Stop"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the current status for the change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/status + /// + /// + /// Operation Id + /// ChangeDataCapture_Status + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> StatusAsync(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Status"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.StatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the current status for the change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName}/status + /// + /// + /// Operation Id + /// ChangeDataCapture_Status + /// + /// + /// + /// The cancellation token to use. + public virtual Response Status(CancellationToken cancellationToken = default) + { + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResource.Status"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Status(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceCollection.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceCollection.cs new file mode 100644 index 000000000000..f20cee4f28b6 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceCollection.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.DataFactory +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetChangeDataCaptureResources method from an instance of . + /// + public partial class ChangeDataCaptureResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _changeDataCaptureResourceChangeDataCaptureClientDiagnostics; + private readonly ChangeDataCaptureRestOperations _changeDataCaptureResourceChangeDataCaptureRestClient; + + /// Initializes a new instance of the class for mocking. + protected ChangeDataCaptureResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ChangeDataCaptureResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _changeDataCaptureResourceChangeDataCaptureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DataFactory", ChangeDataCaptureResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ChangeDataCaptureResource.ResourceType, out string changeDataCaptureResourceChangeDataCaptureApiVersion); + _changeDataCaptureResourceChangeDataCaptureRestClient = new ChangeDataCaptureRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, changeDataCaptureResourceChangeDataCaptureApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataFactoryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataFactoryResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The change data capture name. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string changeDataCaptureName, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, data, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DataFactoryArmOperation(Response.FromValue(new ChangeDataCaptureResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a change data capture resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The change data capture name. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string changeDataCaptureName, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, data, ifMatch, cancellationToken); + var operation = new DataFactoryArmOperation(Response.FromValue(new ChangeDataCaptureResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.Get"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, ifNoneMatch, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ChangeDataCaptureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.Get"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, ifNoneMatch, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ChangeDataCaptureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all resources of type change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs + /// + /// + /// Operation Id + /// ChangeDataCapture_ListByFactory + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _changeDataCaptureResourceChangeDataCaptureRestClient.CreateListByFactoryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _changeDataCaptureResourceChangeDataCaptureRestClient.CreateListByFactoryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChangeDataCaptureResource(Client, ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(e)), _changeDataCaptureResourceChangeDataCaptureClientDiagnostics, Pipeline, "ChangeDataCaptureResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all resources of type change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs + /// + /// + /// Operation Id + /// ChangeDataCapture_ListByFactory + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _changeDataCaptureResourceChangeDataCaptureRestClient.CreateListByFactoryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _changeDataCaptureResourceChangeDataCaptureRestClient.CreateListByFactoryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChangeDataCaptureResource(Client, ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(e)), _changeDataCaptureResourceChangeDataCaptureClientDiagnostics, Pipeline, "ChangeDataCaptureResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _changeDataCaptureResourceChangeDataCaptureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, ifNoneMatch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var scope = _changeDataCaptureResourceChangeDataCaptureClientDiagnostics.CreateScope("ChangeDataCaptureResourceCollection.Exists"); + scope.Start(); + try + { + var response = _changeDataCaptureResourceChangeDataCaptureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, changeDataCaptureName, ifNoneMatch, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceData.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceData.cs new file mode 100644 index 000000000000..f91aa3b758b9 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/ChangeDataCaptureResourceData.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; +using Azure.Core; +using Azure.ResourceManager.DataFactory.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DataFactory +{ + /// + /// A class representing the ChangeDataCaptureResource data model. + /// Change data capture resource type. + /// + public partial class ChangeDataCaptureResourceData : ResourceData + { + /// Initializes a new instance of ChangeDataCaptureResourceData. + /// List of sources connections that can be used as sources in the CDC. + /// List of target connections that can be used as sources in the CDC. + /// CDC policy. + /// , or is null. + public ChangeDataCaptureResourceData(IEnumerable sourceConnectionsInfo, IEnumerable targetConnectionsInfo, MapperPolicy policy) + { + Argument.AssertNotNull(sourceConnectionsInfo, nameof(sourceConnectionsInfo)); + Argument.AssertNotNull(targetConnectionsInfo, nameof(targetConnectionsInfo)); + Argument.AssertNotNull(policy, nameof(policy)); + + SourceConnectionsInfo = sourceConnectionsInfo.ToList(); + TargetConnectionsInfo = targetConnectionsInfo.ToList(); + Policy = policy; + AdditionalProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of ChangeDataCaptureResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The folder that this CDC is in. If not specified, CDC will appear at the root level. + /// The description of the change data capture. + /// List of sources connections that can be used as sources in the CDC. + /// List of target connections that can be used as sources in the CDC. + /// CDC policy. + /// A boolean to determine if the vnet configuration needs to be overwritten. + /// Status of the CDC as to if it is running or stopped. + /// Etag identifies change in the resource. + /// Additional Properties. + internal ChangeDataCaptureResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ChangeDataCaptureFolder folder, string description, IList sourceConnectionsInfo, IList targetConnectionsInfo, MapperPolicy policy, bool? allowVNetOverride, string status, ETag? eTag, IDictionary additionalProperties) : base(id, name, resourceType, systemData) + { + Folder = folder; + Description = description; + SourceConnectionsInfo = sourceConnectionsInfo; + TargetConnectionsInfo = targetConnectionsInfo; + Policy = policy; + AllowVNetOverride = allowVNetOverride; + Status = status; + ETag = eTag; + AdditionalProperties = additionalProperties; + } + + /// The folder that this CDC is in. If not specified, CDC will appear at the root level. + internal ChangeDataCaptureFolder Folder { get; set; } + /// The name of the folder that this CDC is in. + public string FolderName + { + get => Folder is null ? default : Folder.Name; + set + { + if (Folder is null) + Folder = new ChangeDataCaptureFolder(); + Folder.Name = value; + } + } + + /// The description of the change data capture. + public string Description { get; set; } + /// List of sources connections that can be used as sources in the CDC. + public IList SourceConnectionsInfo { get; } + /// List of target connections that can be used as sources in the CDC. + public IList TargetConnectionsInfo { get; } + /// CDC policy. + public MapperPolicy Policy { get; set; } + /// A boolean to determine if the vnet configuration needs to be overwritten. + public bool? AllowVNetOverride { get; set; } + /// Status of the CDC as to if it is running or stopped. + public string Status { get; set; } + /// Etag identifies change in the resource. + public ETag? ETag { get; } + /// + /// Additional Properties + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs index 51258c96d8b5..edf20164f138 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/DataFactoryResource.cs @@ -666,6 +666,61 @@ public virtual Response GetDataFactoryGlobal return GetDataFactoryGlobalParameters().Get(globalParameterName, cancellationToken); } + /// Gets a collection of ChangeDataCaptureResources in the DataFactory. + /// An object representing collection of ChangeDataCaptureResources and their operations over a ChangeDataCaptureResource. + public virtual ChangeDataCaptureResourceCollection GetChangeDataCaptureResources() + { + return GetCachedClient(Client => new ChangeDataCaptureResourceCollection(Client, Id)); + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetChangeDataCaptureResourceAsync(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + return await GetChangeDataCaptureResources().GetAsync(changeDataCaptureName, ifNoneMatch, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a change data capture. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/adfcdcs/{changeDataCaptureName} + /// + /// + /// Operation Id + /// ChangeDataCapture_Get + /// + /// + /// + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetChangeDataCaptureResource(string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + return GetChangeDataCaptureResources().Get(changeDataCaptureName, ifNoneMatch, cancellationToken); + } + /// /// Gets a factory. /// diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs index 7274f910fbda..0789bce7579a 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Extensions/DataFactoryExtensions.cs @@ -278,6 +278,25 @@ public static DataFactoryGlobalParameterResource GetDataFactoryGlobalParameterRe } #endregion + #region ChangeDataCaptureResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ChangeDataCaptureResource GetChangeDataCaptureResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ChangeDataCaptureResource.ValidateResourceId(id); + return new ChangeDataCaptureResource(client, id); + } + ); + } + #endregion + /// Gets a collection of DataFactoryResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of DataFactoryResources and their operations over a DataFactoryResource. diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.Serialization.cs index 6630c890b9ac..e980e8151106 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.Serialization.cs @@ -68,6 +68,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) JsonSerializer.Serialize(writer, ResourceGroupName); writer.WritePropertyName("mlWorkspaceName"u8); JsonSerializer.Serialize(writer, MlWorkspaceName); + if (Optional.IsDefined(Authentication)) + { + writer.WritePropertyName("authentication"u8); + JsonSerializer.Serialize(writer, Authentication); + } if (Optional.IsDefined(ServicePrincipalId)) { writer.WritePropertyName("servicePrincipalId"u8); @@ -119,6 +124,7 @@ internal static AzureMLServiceLinkedService DeserializeAzureMLServiceLinkedServi DataFactoryElement subscriptionId = default; DataFactoryElement resourceGroupName = default; DataFactoryElement mlWorkspaceName = default; + Optional> authentication = default; Optional> servicePrincipalId = default; Optional servicePrincipalKey = default; Optional> tenant = default; @@ -205,6 +211,15 @@ internal static AzureMLServiceLinkedService DeserializeAzureMLServiceLinkedServi mlWorkspaceName = JsonSerializer.Deserialize>(property0.Value.GetRawText()); continue; } + if (property0.NameEquals("authentication"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authentication = JsonSerializer.Deserialize>(property0.Value.GetRawText()); + continue; + } if (property0.NameEquals("servicePrincipalId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -247,7 +262,7 @@ internal static AzureMLServiceLinkedService DeserializeAzureMLServiceLinkedServi additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new AzureMLServiceLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Optional.ToList(annotations), additionalProperties, subscriptionId, resourceGroupName, mlWorkspaceName, servicePrincipalId.Value, servicePrincipalKey.Value, tenant.Value, encryptedCredential.Value); + return new AzureMLServiceLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Optional.ToList(annotations), additionalProperties, subscriptionId, resourceGroupName, mlWorkspaceName, authentication.Value, servicePrincipalId.Value, servicePrincipalKey.Value, tenant.Value, encryptedCredential.Value); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.cs index 07a0c3c97551..3fa7dc9dbf96 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/AzureMLServiceLinkedService.cs @@ -42,6 +42,7 @@ public AzureMLServiceLinkedService(DataFactoryElement subscriptionId, Da /// Azure ML Service workspace subscription ID. Type: string (or Expression with resultType string). /// Azure ML Service workspace resource group name. Type: string (or Expression with resultType string). /// Azure ML Service workspace name. Type: string (or Expression with resultType string). + /// Type of authentication (Required to specify MSI) used to connect to AzureML. Type: string (or Expression with resultType string). /// The ID of the service principal used to authenticate against the endpoint of a published Azure ML Service pipeline. Type: string (or Expression with resultType string). /// /// The key of the service principal used to authenticate against the endpoint of a published Azure ML Service pipeline. @@ -50,11 +51,12 @@ public AzureMLServiceLinkedService(DataFactoryElement subscriptionId, Da /// /// The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). /// The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string. - internal AzureMLServiceLinkedService(string linkedServiceType, IntegrationRuntimeReference connectVia, string description, IDictionary parameters, IList annotations, IDictionary additionalProperties, DataFactoryElement subscriptionId, DataFactoryElement resourceGroupName, DataFactoryElement mlWorkspaceName, DataFactoryElement servicePrincipalId, DataFactorySecretBaseDefinition servicePrincipalKey, DataFactoryElement tenant, BinaryData encryptedCredential) : base(linkedServiceType, connectVia, description, parameters, annotations, additionalProperties) + internal AzureMLServiceLinkedService(string linkedServiceType, IntegrationRuntimeReference connectVia, string description, IDictionary parameters, IList annotations, IDictionary additionalProperties, DataFactoryElement subscriptionId, DataFactoryElement resourceGroupName, DataFactoryElement mlWorkspaceName, DataFactoryElement authentication, DataFactoryElement servicePrincipalId, DataFactorySecretBaseDefinition servicePrincipalKey, DataFactoryElement tenant, BinaryData encryptedCredential) : base(linkedServiceType, connectVia, description, parameters, annotations, additionalProperties) { SubscriptionId = subscriptionId; ResourceGroupName = resourceGroupName; MlWorkspaceName = mlWorkspaceName; + Authentication = authentication; ServicePrincipalId = servicePrincipalId; ServicePrincipalKey = servicePrincipalKey; Tenant = tenant; @@ -68,6 +70,8 @@ internal AzureMLServiceLinkedService(string linkedServiceType, IntegrationRuntim public DataFactoryElement ResourceGroupName { get; set; } /// Azure ML Service workspace name. Type: string (or Expression with resultType string). public DataFactoryElement MlWorkspaceName { get; set; } + /// Type of authentication (Required to specify MSI) used to connect to AzureML. Type: string (or Expression with resultType string). + public DataFactoryElement Authentication { get; set; } /// The ID of the service principal used to authenticate against the endpoint of a published Azure ML Service pipeline. Type: string (or Expression with resultType string). public DataFactoryElement ServicePrincipalId { get; set; } /// diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.Serialization.cs new file mode 100644 index 000000000000..b4577f45f216 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + internal partial class ChangeDataCaptureFolder : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static ChangeDataCaptureFolder DeserializeChangeDataCaptureFolder(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + } + return new ChangeDataCaptureFolder(name.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.cs new file mode 100644 index 000000000000..39a62905c0c3 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureFolder.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// The folder that this CDC is in. If not specified, CDC will appear at the root level. + internal partial class ChangeDataCaptureFolder + { + /// Initializes a new instance of ChangeDataCaptureFolder. + public ChangeDataCaptureFolder() + { + } + + /// Initializes a new instance of ChangeDataCaptureFolder. + /// The name of the folder that this CDC is in. + internal ChangeDataCaptureFolder(string name) + { + Name = name; + } + + /// The name of the folder that this CDC is in. + public string Name { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.Serialization.cs new file mode 100644 index 000000000000..a59f0bc56aa4 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DataFactory; + +namespace Azure.ResourceManager.DataFactory.Models +{ + internal partial class ChangeDataCaptureListResponse + { + internal static ChangeDataCaptureListResponse DeserializeChangeDataCaptureListResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ChangeDataCaptureListResponse(value, nextLink.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.cs new file mode 100644 index 000000000000..0b1faebdc655 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureListResponse.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.DataFactory; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// A list of change data capture resources. + internal partial class ChangeDataCaptureListResponse + { + /// Initializes a new instance of ChangeDataCaptureListResponse. + /// Lists all resources of type change data capture. + /// is null. + internal ChangeDataCaptureListResponse(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of ChangeDataCaptureListResponse. + /// Lists all resources of type change data capture. + /// The link to the next page of results, if any remaining results exist. + internal ChangeDataCaptureListResponse(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Lists all resources of type change data capture. + public IReadOnlyList Value { get; } + /// The link to the next page of results, if any remaining results exist. + public string NextLink { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureResourceData.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureResourceData.Serialization.cs new file mode 100644 index 000000000000..d5cd425e9da8 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ChangeDataCaptureResourceData.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.DataFactory.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DataFactory +{ + public partial class ChangeDataCaptureResourceData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Folder)) + { + writer.WritePropertyName("folder"u8); + writer.WriteObjectValue(Folder); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("sourceConnectionsInfo"u8); + writer.WriteStartArray(); + foreach (var item in SourceConnectionsInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("targetConnectionsInfo"u8); + writer.WriteStartArray(); + foreach (var item in TargetConnectionsInfo) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("policy"u8); + writer.WriteObjectValue(Policy); + if (Optional.IsDefined(AllowVNetOverride)) + { + writer.WritePropertyName("allowVNetOverride"u8); + writer.WriteBooleanValue(AllowVNetOverride.Value); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + writer.WriteEndObject(); + foreach (var item in AdditionalProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + + internal static ChangeDataCaptureResourceData DeserializeChangeDataCaptureResourceData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional folder = default; + Optional description = default; + IList sourceConnectionsInfo = default; + IList targetConnectionsInfo = default; + MapperPolicy policy = default; + Optional allowVNetOverride = default; + Optional status = default; + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("folder"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + folder = ChangeDataCaptureFolder.DeserializeChangeDataCaptureFolder(property0.Value); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("sourceConnectionsInfo"u8)) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MapperSourceConnectionsInfo.DeserializeMapperSourceConnectionsInfo(item)); + } + sourceConnectionsInfo = array; + continue; + } + if (property0.NameEquals("targetConnectionsInfo"u8)) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MapperTargetConnectionsInfo.DeserializeMapperTargetConnectionsInfo(item)); + } + targetConnectionsInfo = array; + continue; + } + if (property0.NameEquals("policy"u8)) + { + policy = MapperPolicy.DeserializeMapperPolicy(property0.Value); + continue; + } + if (property0.NameEquals("allowVNetOverride"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowVNetOverride = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("status"u8)) + { + status = property0.Value.GetString(); + continue; + } + } + continue; + } + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new ChangeDataCaptureResourceData(id, name, type, systemData.Value, folder.Value, description.Value, sourceConnectionsInfo, targetConnectionsInfo, policy, Optional.ToNullable(allowVNetOverride), status.Value, Optional.ToNullable(etag), additionalProperties); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ConnectionType.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ConnectionType.cs new file mode 100644 index 000000000000..af84651d4b05 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/ConnectionType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Type of connection via linked service or dataset. + public readonly partial struct ConnectionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LinkedservicetypeValue = "linkedservicetype"; + + /// linkedservicetype. + public static ConnectionType Linkedservicetype { get; } = new ConnectionType(LinkedservicetypeValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionType left, ConnectionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionType left, ConnectionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ConnectionType(string value) => new ConnectionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionType other && Equals(other); + /// + public bool Equals(ConnectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.Serialization.cs new file mode 100644 index 000000000000..55f8627523c4 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class DataMapperMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(TargetEntityName)) + { + writer.WritePropertyName("targetEntityName"u8); + writer.WriteStringValue(TargetEntityName); + } + if (Optional.IsDefined(SourceEntityName)) + { + writer.WritePropertyName("sourceEntityName"u8); + writer.WriteStringValue(SourceEntityName); + } + if (Optional.IsDefined(SourceConnectionReference)) + { + writer.WritePropertyName("sourceConnectionReference"u8); + writer.WriteObjectValue(SourceConnectionReference); + } + if (Optional.IsDefined(AttributeMappingInfo)) + { + writer.WritePropertyName("attributeMappingInfo"u8); + writer.WriteObjectValue(AttributeMappingInfo); + } + if (Optional.IsDefined(SourceDenormalizeInfo)) + { + writer.WritePropertyName("sourceDenormalizeInfo"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(SourceDenormalizeInfo); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(SourceDenormalizeInfo.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + + internal static DataMapperMapping DeserializeDataMapperMapping(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional targetEntityName = default; + Optional sourceEntityName = default; + Optional sourceConnectionReference = default; + Optional attributeMappingInfo = default; + Optional sourceDenormalizeInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetEntityName"u8)) + { + targetEntityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceEntityName"u8)) + { + sourceEntityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceConnectionReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceConnectionReference = MapperConnectionReference.DeserializeMapperConnectionReference(property.Value); + continue; + } + if (property.NameEquals("attributeMappingInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + attributeMappingInfo = MapperAttributeMappings.DeserializeMapperAttributeMappings(property.Value); + continue; + } + if (property.NameEquals("sourceDenormalizeInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDenormalizeInfo = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + } + return new DataMapperMapping(targetEntityName.Value, sourceEntityName.Value, sourceConnectionReference.Value, attributeMappingInfo.Value, sourceDenormalizeInfo.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.cs new file mode 100644 index 000000000000..a42a3d2b62b8 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataMapperMapping.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Source and target table mapping details. + public partial class DataMapperMapping + { + /// Initializes a new instance of DataMapperMapping. + public DataMapperMapping() + { + } + + /// Initializes a new instance of DataMapperMapping. + /// Name of the target table. + /// Name of the source table. + /// The connection reference for the source connection. + /// This holds the user provided attribute mapping information. + /// This holds the source denormalization information used while joining multiple sources. + internal DataMapperMapping(string targetEntityName, string sourceEntityName, MapperConnectionReference sourceConnectionReference, MapperAttributeMappings attributeMappingInfo, BinaryData sourceDenormalizeInfo) + { + TargetEntityName = targetEntityName; + SourceEntityName = sourceEntityName; + SourceConnectionReference = sourceConnectionReference; + AttributeMappingInfo = attributeMappingInfo; + SourceDenormalizeInfo = sourceDenormalizeInfo; + } + + /// Name of the target table. + public string TargetEntityName { get; set; } + /// Name of the source table. + public string SourceEntityName { get; set; } + /// The connection reference for the source connection. + public MapperConnectionReference SourceConnectionReference { get; set; } + /// This holds the user provided attribute mapping information. + internal MapperAttributeMappings AttributeMappingInfo { get; set; } + /// List of attribute mappings. + public IList AttributeMappings + { + get + { + if (AttributeMappingInfo is null) + AttributeMappingInfo = new MapperAttributeMappings(); + return AttributeMappingInfo.AttributeMappings; + } + } + + /// + /// This holds the source denormalization information used while joining multiple sources. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData SourceDenormalizeInfo { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/FrequencyType.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/FrequencyType.cs new file mode 100644 index 000000000000..c475ef61247b --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/FrequencyType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Frequency of period in terms of 'Hour', 'Minute' or 'Second'. + public readonly partial struct FrequencyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FrequencyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HourValue = "Hour"; + private const string MinuteValue = "Minute"; + private const string SecondValue = "Second"; + + /// Hour. + public static FrequencyType Hour { get; } = new FrequencyType(HourValue); + /// Minute. + public static FrequencyType Minute { get; } = new FrequencyType(MinuteValue); + /// Second. + public static FrequencyType Second { get; } = new FrequencyType(SecondValue); + /// Determines if two values are the same. + public static bool operator ==(FrequencyType left, FrequencyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FrequencyType left, FrequencyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FrequencyType(string value) => new FrequencyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FrequencyType other && Equals(other); + /// + public bool Equals(FrequencyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.Serialization.cs new file mode 100644 index 000000000000..edd781026a75 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperAttributeMapping : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(MappingType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(MappingType.Value.ToString()); + } + if (Optional.IsDefined(FunctionName)) + { + writer.WritePropertyName("functionName"u8); + writer.WriteStringValue(FunctionName); + } + if (Optional.IsDefined(Expression)) + { + writer.WritePropertyName("expression"u8); + writer.WriteStringValue(Expression); + } + if (Optional.IsDefined(AttributeReference)) + { + writer.WritePropertyName("attributeReference"u8); + writer.WriteObjectValue(AttributeReference); + } + if (Optional.IsCollectionDefined(AttributeReferences)) + { + writer.WritePropertyName("attributeReferences"u8); + writer.WriteStartArray(); + foreach (var item in AttributeReferences) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MapperAttributeMapping DeserializeMapperAttributeMapping(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional type = default; + Optional functionName = default; + Optional expression = default; + Optional attributeReference = default; + Optional> attributeReferences = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new MappingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("functionName"u8)) + { + functionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("expression"u8)) + { + expression = property.Value.GetString(); + continue; + } + if (property.NameEquals("attributeReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + attributeReference = MapperAttributeReference.DeserializeMapperAttributeReference(property.Value); + continue; + } + if (property.NameEquals("attributeReferences"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MapperAttributeReference.DeserializeMapperAttributeReference(item)); + } + attributeReferences = array; + continue; + } + } + return new MapperAttributeMapping(name.Value, Optional.ToNullable(type), functionName.Value, expression.Value, attributeReference.Value, Optional.ToList(attributeReferences)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.cs new file mode 100644 index 000000000000..b7ed23e4de95 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMapping.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Source and target column mapping details. + public partial class MapperAttributeMapping + { + /// Initializes a new instance of MapperAttributeMapping. + public MapperAttributeMapping() + { + AttributeReferences = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperAttributeMapping. + /// Name of the target column. + /// Type of the CDC attribute mapping. Note: 'Advanced' mapping type is also saved as 'Derived'. + /// Name of the function used for 'Aggregate' and 'Derived' (except 'Advanced') type mapping. + /// Expression used for 'Aggregate' and 'Derived' type mapping. + /// Reference of the source column used in the mapping. It is used for 'Direct' mapping type only. + /// List of references for source columns. It is used for 'Derived' and 'Aggregate' type mappings only. + internal MapperAttributeMapping(string name, MappingType? mappingType, string functionName, string expression, MapperAttributeReference attributeReference, IList attributeReferences) + { + Name = name; + MappingType = mappingType; + FunctionName = functionName; + Expression = expression; + AttributeReference = attributeReference; + AttributeReferences = attributeReferences; + } + + /// Name of the target column. + public string Name { get; set; } + /// Type of the CDC attribute mapping. Note: 'Advanced' mapping type is also saved as 'Derived'. + public MappingType? MappingType { get; set; } + /// Name of the function used for 'Aggregate' and 'Derived' (except 'Advanced') type mapping. + public string FunctionName { get; set; } + /// Expression used for 'Aggregate' and 'Derived' type mapping. + public string Expression { get; set; } + /// Reference of the source column used in the mapping. It is used for 'Direct' mapping type only. + public MapperAttributeReference AttributeReference { get; set; } + /// List of references for source columns. It is used for 'Derived' and 'Aggregate' type mappings only. + public IList AttributeReferences { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.Serialization.cs new file mode 100644 index 000000000000..87d267f6a177 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + internal partial class MapperAttributeMappings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AttributeMappings)) + { + writer.WritePropertyName("attributeMappings"u8); + writer.WriteStartArray(); + foreach (var item in AttributeMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MapperAttributeMappings DeserializeMapperAttributeMappings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> attributeMappings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributeMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MapperAttributeMapping.DeserializeMapperAttributeMapping(item)); + } + attributeMappings = array; + continue; + } + } + return new MapperAttributeMappings(Optional.ToList(attributeMappings)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.cs new file mode 100644 index 000000000000..4df3e3071bff --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeMappings.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Attribute mapping details. + internal partial class MapperAttributeMappings + { + /// Initializes a new instance of MapperAttributeMappings. + public MapperAttributeMappings() + { + AttributeMappings = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperAttributeMappings. + /// List of attribute mappings. + internal MapperAttributeMappings(IList attributeMappings) + { + AttributeMappings = attributeMappings; + } + + /// List of attribute mappings. + public IList AttributeMappings { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.Serialization.cs new file mode 100644 index 000000000000..2dae39b0372c --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperAttributeReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Entity)) + { + writer.WritePropertyName("entity"u8); + writer.WriteStringValue(Entity); + } + if (Optional.IsDefined(EntityConnectionReference)) + { + writer.WritePropertyName("entityConnectionReference"u8); + writer.WriteObjectValue(EntityConnectionReference); + } + writer.WriteEndObject(); + } + + internal static MapperAttributeReference DeserializeMapperAttributeReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional entity = default; + Optional entityConnectionReference = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("entity"u8)) + { + entity = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityConnectionReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + entityConnectionReference = MapperConnectionReference.DeserializeMapperConnectionReference(property.Value); + continue; + } + } + return new MapperAttributeReference(name.Value, entity.Value, entityConnectionReference.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.cs new file mode 100644 index 000000000000..17bcb73af84a --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperAttributeReference.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Attribute reference details for the referred column. + public partial class MapperAttributeReference + { + /// Initializes a new instance of MapperAttributeReference. + public MapperAttributeReference() + { + } + + /// Initializes a new instance of MapperAttributeReference. + /// Name of the column. + /// Name of the table. + /// The connection reference for the connection. + internal MapperAttributeReference(string name, string entity, MapperConnectionReference entityConnectionReference) + { + Name = name; + Entity = entity; + EntityConnectionReference = entityConnectionReference; + } + + /// Name of the column. + public string Name { get; set; } + /// Name of the table. + public string Entity { get; set; } + /// The connection reference for the connection. + public MapperConnectionReference EntityConnectionReference { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.Serialization.cs new file mode 100644 index 000000000000..30cd0c385b20 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.Serialization.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperConnection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(LinkedService)) + { + writer.WritePropertyName("linkedService"u8); + writer.WriteObjectValue(LinkedService); + } + if (Optional.IsDefined(LinkedServiceType)) + { + writer.WritePropertyName("linkedServiceType"u8); + writer.WriteStringValue(LinkedServiceType); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ConnectionType.ToString()); + if (Optional.IsDefined(IsInlineDataset)) + { + writer.WritePropertyName("isInlineDataset"u8); + writer.WriteBooleanValue(IsInlineDataset.Value); + } + if (Optional.IsCollectionDefined(CommonDslConnectorProperties)) + { + writer.WritePropertyName("commonDslConnectorProperties"u8); + writer.WriteStartArray(); + foreach (var item in CommonDslConnectorProperties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MapperConnection DeserializeMapperConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional linkedService = default; + Optional linkedServiceType = default; + ConnectionType type = default; + Optional isInlineDataset = default; + Optional> commonDslConnectorProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("linkedService"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linkedService = DataFactoryLinkedServiceReference.DeserializeDataFactoryLinkedServiceReference(property.Value); + continue; + } + if (property.NameEquals("linkedServiceType"u8)) + { + linkedServiceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ConnectionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isInlineDataset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isInlineDataset = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("commonDslConnectorProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MapperDslConnectorProperties.DeserializeMapperDslConnectorProperties(item)); + } + commonDslConnectorProperties = array; + continue; + } + } + return new MapperConnection(linkedService.Value, linkedServiceType.Value, type, Optional.ToNullable(isInlineDataset), Optional.ToList(commonDslConnectorProperties)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.cs new file mode 100644 index 000000000000..0e8aa8deb9cb --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnection.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Source connection details. + public partial class MapperConnection + { + /// Initializes a new instance of MapperConnection. + /// Type of connection via linked service or dataset. + public MapperConnection(ConnectionType connectionType) + { + ConnectionType = connectionType; + CommonDslConnectorProperties = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperConnection. + /// Linked service reference. + /// Type of the linked service e.g.: AzureBlobFS. + /// Type of connection via linked service or dataset. + /// A boolean indicating whether linked service is of type inline dataset. Currently only inline datasets are supported. + /// List of name/value pairs for connection properties. + internal MapperConnection(DataFactoryLinkedServiceReference linkedService, string linkedServiceType, ConnectionType connectionType, bool? isInlineDataset, IList commonDslConnectorProperties) + { + LinkedService = linkedService; + LinkedServiceType = linkedServiceType; + ConnectionType = connectionType; + IsInlineDataset = isInlineDataset; + CommonDslConnectorProperties = commonDslConnectorProperties; + } + + /// Linked service reference. + public DataFactoryLinkedServiceReference LinkedService { get; set; } + /// Type of the linked service e.g.: AzureBlobFS. + public string LinkedServiceType { get; set; } + /// Type of connection via linked service or dataset. + public ConnectionType ConnectionType { get; set; } + /// A boolean indicating whether linked service is of type inline dataset. Currently only inline datasets are supported. + public bool? IsInlineDataset { get; set; } + /// List of name/value pairs for connection properties. + public IList CommonDslConnectorProperties { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.Serialization.cs new file mode 100644 index 000000000000..7ae9290e48b0 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperConnectionReference : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ConnectionName)) + { + writer.WritePropertyName("connectionName"u8); + writer.WriteStringValue(ConnectionName); + } + if (Optional.IsDefined(ConnectionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ConnectionType.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static MapperConnectionReference DeserializeMapperConnectionReference(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional connectionName = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionName"u8)) + { + connectionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ConnectionType(property.Value.GetString()); + continue; + } + } + return new MapperConnectionReference(connectionName.Value, Optional.ToNullable(type)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.cs new file mode 100644 index 000000000000..094d5a16b9ce --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperConnectionReference.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Source or target connection reference details. + public partial class MapperConnectionReference + { + /// Initializes a new instance of MapperConnectionReference. + public MapperConnectionReference() + { + } + + /// Initializes a new instance of MapperConnectionReference. + /// Name of the connection. + /// Type of connection via linked service or dataset. + internal MapperConnectionReference(string connectionName, ConnectionType? connectionType) + { + ConnectionName = connectionName; + ConnectionType = connectionType; + } + + /// Name of the connection. + public string ConnectionName { get; set; } + /// Type of connection via linked service or dataset. + public ConnectionType? ConnectionType { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.Serialization.cs new file mode 100644 index 000000000000..d1060ace7f70 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperDslConnectorProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + + internal static MapperDslConnectorProperties DeserializeMapperDslConnectorProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + } + return new MapperDslConnectorProperties(name.Value, value.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.cs new file mode 100644 index 000000000000..81ba26c4f5a1 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperDslConnectorProperties.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Connector properties of a CDC table in terms of name / value pairs. + public partial class MapperDslConnectorProperties + { + /// Initializes a new instance of MapperDslConnectorProperties. + public MapperDslConnectorProperties() + { + } + + /// Initializes a new instance of MapperDslConnectorProperties. + /// Name of the property. + /// Value of the property. + internal MapperDslConnectorProperties(string name, BinaryData value) + { + Name = name; + Value = value; + } + + /// Name of the property. + public string Name { get; set; } + /// + /// Value of the property. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Value { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.Serialization.cs new file mode 100644 index 000000000000..2f3b900167a5 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode); + } + if (Optional.IsDefined(Recurrence)) + { + writer.WritePropertyName("recurrence"u8); + writer.WriteObjectValue(Recurrence); + } + writer.WriteEndObject(); + } + + internal static MapperPolicy DeserializeMapperPolicy(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional mode = default; + Optional recurrence = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + mode = property.Value.GetString(); + continue; + } + if (property.NameEquals("recurrence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recurrence = MapperPolicyRecurrence.DeserializeMapperPolicyRecurrence(property.Value); + continue; + } + } + return new MapperPolicy(mode.Value, recurrence.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.cs new file mode 100644 index 000000000000..315c0989c64e --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicy.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// CDC Policy. + public partial class MapperPolicy + { + /// Initializes a new instance of MapperPolicy. + public MapperPolicy() + { + } + + /// Initializes a new instance of MapperPolicy. + /// Mode of running the CDC: batch vs continuous. + /// Defines the frequency and interval for running the CDC for batch mode. + internal MapperPolicy(string mode, MapperPolicyRecurrence recurrence) + { + Mode = mode; + Recurrence = recurrence; + } + + /// Mode of running the CDC: batch vs continuous. + public string Mode { get; set; } + /// Defines the frequency and interval for running the CDC for batch mode. + public MapperPolicyRecurrence Recurrence { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.Serialization.cs new file mode 100644 index 000000000000..c2a9308570c4 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperPolicyRecurrence : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Frequency)) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.Value.ToString()); + } + if (Optional.IsDefined(Interval)) + { + writer.WritePropertyName("interval"u8); + writer.WriteNumberValue(Interval.Value); + } + writer.WriteEndObject(); + } + + internal static MapperPolicyRecurrence DeserializeMapperPolicyRecurrence(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional frequency = default; + Optional interval = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequency = new FrequencyType(property.Value.GetString()); + continue; + } + if (property.NameEquals("interval"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + interval = property.Value.GetInt32(); + continue; + } + } + return new MapperPolicyRecurrence(Optional.ToNullable(frequency), Optional.ToNullable(interval)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.cs new file mode 100644 index 000000000000..aa2800b90744 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperPolicyRecurrence.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// CDC policy recurrence details. + public partial class MapperPolicyRecurrence + { + /// Initializes a new instance of MapperPolicyRecurrence. + public MapperPolicyRecurrence() + { + } + + /// Initializes a new instance of MapperPolicyRecurrence. + /// Frequency of period in terms of 'Hour', 'Minute' or 'Second'. + /// Actual interval value as per chosen frequency. + internal MapperPolicyRecurrence(FrequencyType? frequency, int? interval) + { + Frequency = frequency; + Interval = interval; + } + + /// Frequency of period in terms of 'Hour', 'Minute' or 'Second'. + public FrequencyType? Frequency { get; set; } + /// Actual interval value as per chosen frequency. + public int? Interval { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.Serialization.cs new file mode 100644 index 000000000000..efba10087669 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperSourceConnectionsInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(SourceEntities)) + { + writer.WritePropertyName("sourceEntities"u8); + writer.WriteStartArray(); + foreach (var item in SourceEntities) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Connection)) + { + writer.WritePropertyName("connection"u8); + writer.WriteObjectValue(Connection); + } + writer.WriteEndObject(); + } + + internal static MapperSourceConnectionsInfo DeserializeMapperSourceConnectionsInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> sourceEntities = default; + Optional connection = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceEntities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MapperTable.DeserializeMapperTable(item)); + } + sourceEntities = array; + continue; + } + if (property.NameEquals("connection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connection = MapperConnection.DeserializeMapperConnection(property.Value); + continue; + } + } + return new MapperSourceConnectionsInfo(Optional.ToList(sourceEntities), connection.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.cs new file mode 100644 index 000000000000..70f9d44134b0 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperSourceConnectionsInfo.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// A object which contains list of tables and connection details for a source connection. + public partial class MapperSourceConnectionsInfo + { + /// Initializes a new instance of MapperSourceConnectionsInfo. + public MapperSourceConnectionsInfo() + { + SourceEntities = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperSourceConnectionsInfo. + /// List of source tables for a source connection. + /// Source connection details. + internal MapperSourceConnectionsInfo(IList sourceEntities, MapperConnection connection) + { + SourceEntities = sourceEntities; + Connection = connection; + } + + /// List of source tables for a source connection. + public IList SourceEntities { get; } + /// Source connection details. + public MapperConnection Connection { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.Serialization.cs new file mode 100644 index 000000000000..a8b03e652743 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperTable : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Schema)) + { + writer.WritePropertyName("schema"u8); + writer.WriteStartArray(); + foreach (var item in Schema) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DslConnectorProperties)) + { + writer.WritePropertyName("dslConnectorProperties"u8); + writer.WriteStartArray(); + foreach (var item in DslConnectorProperties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MapperTable DeserializeMapperTable(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional> schema = default; + Optional> dslConnectorProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("schema"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MapperTableSchema.DeserializeMapperTableSchema(item)); + } + schema = array; + continue; + } + if (property0.NameEquals("dslConnectorProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MapperDslConnectorProperties.DeserializeMapperDslConnectorProperties(item)); + } + dslConnectorProperties = array; + continue; + } + } + continue; + } + } + return new MapperTable(name.Value, Optional.ToList(schema), Optional.ToList(dslConnectorProperties)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.cs new file mode 100644 index 000000000000..ef8bf56d2b1c --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTable.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// CDC table details. + public partial class MapperTable + { + /// Initializes a new instance of MapperTable. + public MapperTable() + { + Schema = new ChangeTrackingList(); + DslConnectorProperties = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperTable. + /// Name of the table. + /// List of columns for the source table. + /// List of name/value pairs for connection properties. + internal MapperTable(string name, IList schema, IList dslConnectorProperties) + { + Name = name; + Schema = schema; + DslConnectorProperties = dslConnectorProperties; + } + + /// Name of the table. + public string Name { get; set; } + /// List of columns for the source table. + public IList Schema { get; } + /// List of name/value pairs for connection properties. + public IList DslConnectorProperties { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.Serialization.cs new file mode 100644 index 000000000000..f4a128667540 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperTableSchema : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DataType)) + { + writer.WritePropertyName("dataType"u8); + writer.WriteStringValue(DataType); + } + writer.WriteEndObject(); + } + + internal static MapperTableSchema DeserializeMapperTableSchema(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional dataType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataType"u8)) + { + dataType = property.Value.GetString(); + continue; + } + } + return new MapperTableSchema(name.Value, dataType.Value); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.cs new file mode 100644 index 000000000000..285353e2563a --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTableSchema.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Schema of a CDC table in terms of column names and their corresponding data types. + public partial class MapperTableSchema + { + /// Initializes a new instance of MapperTableSchema. + public MapperTableSchema() + { + } + + /// Initializes a new instance of MapperTableSchema. + /// Name of the column. + /// Data type of the column. + internal MapperTableSchema(string name, string dataType) + { + Name = name; + DataType = dataType; + } + + /// Name of the column. + public string Name { get; set; } + /// Data type of the column. + public string DataType { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.Serialization.cs new file mode 100644 index 000000000000..316b5be17bfe --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class MapperTargetConnectionsInfo : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(TargetEntities)) + { + writer.WritePropertyName("targetEntities"u8); + writer.WriteStartArray(); + foreach (var item in TargetEntities) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Connection)) + { + writer.WritePropertyName("connection"u8); + writer.WriteObjectValue(Connection); + } + if (Optional.IsCollectionDefined(DataMapperMappings)) + { + writer.WritePropertyName("dataMapperMappings"u8); + writer.WriteStartArray(); + foreach (var item in DataMapperMappings) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Relationships)) + { + writer.WritePropertyName("relationships"u8); + writer.WriteStartArray(); + foreach (var item in Relationships) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.ToString()).RootElement); +#endif + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static MapperTargetConnectionsInfo DeserializeMapperTargetConnectionsInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> targetEntities = default; + Optional connection = default; + Optional> dataMapperMappings = default; + Optional> relationships = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetEntities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MapperTable.DeserializeMapperTable(item)); + } + targetEntities = array; + continue; + } + if (property.NameEquals("connection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connection = MapperConnection.DeserializeMapperConnection(property.Value); + continue; + } + if (property.NameEquals("dataMapperMappings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataMapperMapping.DeserializeDataMapperMapping(item)); + } + dataMapperMappings = array; + continue; + } + if (property.NameEquals("relationships"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(BinaryData.FromString(item.GetRawText())); + } + } + relationships = array; + continue; + } + } + return new MapperTargetConnectionsInfo(Optional.ToList(targetEntities), connection.Value, Optional.ToList(dataMapperMappings), Optional.ToList(relationships)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.cs new file mode 100644 index 000000000000..95a846ba1b6f --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MapperTargetConnectionsInfo.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// A object which contains list of tables and connection details for a target connection. + public partial class MapperTargetConnectionsInfo + { + /// Initializes a new instance of MapperTargetConnectionsInfo. + public MapperTargetConnectionsInfo() + { + TargetEntities = new ChangeTrackingList(); + DataMapperMappings = new ChangeTrackingList(); + Relationships = new ChangeTrackingList(); + } + + /// Initializes a new instance of MapperTargetConnectionsInfo. + /// List of source tables for a target connection. + /// Source connection details. + /// List of table mappings. + /// List of relationship info among the tables. + internal MapperTargetConnectionsInfo(IList targetEntities, MapperConnection connection, IList dataMapperMappings, IList relationships) + { + TargetEntities = targetEntities; + Connection = connection; + DataMapperMappings = dataMapperMappings; + Relationships = relationships; + } + + /// List of source tables for a target connection. + public IList TargetEntities { get; } + /// Source connection details. + public MapperConnection Connection { get; set; } + /// List of table mappings. + public IList DataMapperMappings { get; } + /// + /// List of relationship info among the tables. + /// + /// To assign an object to the element of this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IList Relationships { get; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MappingType.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MappingType.cs new file mode 100644 index 000000000000..eb3036a51b8f --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MappingType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Type of the CDC attribute mapping. Note: 'Advanced' mapping type is also saved as 'Derived'. + public readonly partial struct MappingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MappingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DirectValue = "Direct"; + private const string DerivedValue = "Derived"; + private const string AggregateValue = "Aggregate"; + + /// Direct. + public static MappingType Direct { get; } = new MappingType(DirectValue); + /// Derived. + public static MappingType Derived { get; } = new MappingType(DerivedValue); + /// Aggregate. + public static MappingType Aggregate { get; } = new MappingType(AggregateValue); + /// Determines if two values are the same. + public static bool operator ==(MappingType left, MappingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MappingType left, MappingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MappingType(string value) => new MappingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MappingType other && Equals(other); + /// + public bool Equals(MappingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.Serialization.cs index 25fd3b86cf70..a8c66450bc0f 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.Serialization.cs @@ -66,10 +66,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) JsonSerializer.Serialize(writer, ConnectionString); writer.WritePropertyName("database"u8); JsonSerializer.Serialize(writer, Database); - if (Optional.IsDefined(MongoDBAtlasDriverVersion)) + if (Optional.IsDefined(DriverVersion)) { - writer.WritePropertyName("mongoDbAtlasDriverVersion"u8); - JsonSerializer.Serialize(writer, MongoDBAtlasDriverVersion); + writer.WritePropertyName("driverVersion"u8); + JsonSerializer.Serialize(writer, DriverVersion); } writer.WriteEndObject(); foreach (var item in AdditionalProperties) @@ -97,7 +97,7 @@ internal static MongoDBAtlasLinkedService DeserializeMongoDBAtlasLinkedService(J Optional> annotations = default; DataFactoryElement connectionString = default; DataFactoryElement database = default; - Optional> mongoDBAtlasDriverVersion = default; + Optional> driverVersion = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -175,13 +175,13 @@ internal static MongoDBAtlasLinkedService DeserializeMongoDBAtlasLinkedService(J database = JsonSerializer.Deserialize>(property0.Value.GetRawText()); continue; } - if (property0.NameEquals("mongoDbAtlasDriverVersion"u8)) + if (property0.NameEquals("driverVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - mongoDBAtlasDriverVersion = JsonSerializer.Deserialize>(property0.Value.GetRawText()); + driverVersion = JsonSerializer.Deserialize>(property0.Value.GetRawText()); continue; } } @@ -190,7 +190,7 @@ internal static MongoDBAtlasLinkedService DeserializeMongoDBAtlasLinkedService(J additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new MongoDBAtlasLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Optional.ToList(annotations), additionalProperties, connectionString, database, mongoDBAtlasDriverVersion.Value); + return new MongoDBAtlasLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Optional.ToList(annotations), additionalProperties, connectionString, database, driverVersion.Value); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.cs index fae80e904f21..dc366433cf50 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/MongoDBAtlasLinkedService.cs @@ -38,12 +38,12 @@ public MongoDBAtlasLinkedService(DataFactoryElement connectionString, Da /// Additional Properties. /// The MongoDB Atlas connection string. Type: string, SecureString or AzureKeyVaultSecretReference. Type: string, SecureString or AzureKeyVaultSecretReference. /// The name of the MongoDB Atlas database that you want to access. Type: string (or Expression with resultType string). - /// The MongoDB Atlas Driver version that you want to choose. Allowed value are 2.10.4 and 2.19.0. Type: string (or Expression with resultType string). - internal MongoDBAtlasLinkedService(string linkedServiceType, IntegrationRuntimeReference connectVia, string description, IDictionary parameters, IList annotations, IDictionary additionalProperties, DataFactoryElement connectionString, DataFactoryElement database, DataFactoryElement mongoDBAtlasDriverVersion) : base(linkedServiceType, connectVia, description, parameters, annotations, additionalProperties) + /// The driver version that you want to choose. Allowed value are v1 and v2. Type: string (or Expression with resultType string). + internal MongoDBAtlasLinkedService(string linkedServiceType, IntegrationRuntimeReference connectVia, string description, IDictionary parameters, IList annotations, IDictionary additionalProperties, DataFactoryElement connectionString, DataFactoryElement database, DataFactoryElement driverVersion) : base(linkedServiceType, connectVia, description, parameters, annotations, additionalProperties) { ConnectionString = connectionString; Database = database; - MongoDBAtlasDriverVersion = mongoDBAtlasDriverVersion; + DriverVersion = driverVersion; LinkedServiceType = linkedServiceType ?? "MongoDbAtlas"; } @@ -51,7 +51,7 @@ internal MongoDBAtlasLinkedService(string linkedServiceType, IntegrationRuntimeR public DataFactoryElement ConnectionString { get; set; } /// The name of the MongoDB Atlas database that you want to access. Type: string (or Expression with resultType string). public DataFactoryElement Database { get; set; } - /// The MongoDB Atlas Driver version that you want to choose. Allowed value are 2.10.4 and 2.19.0. Type: string (or Expression with resultType string). - public DataFactoryElement MongoDBAtlasDriverVersion { get; set; } + /// The driver version that you want to choose. Allowed value are v1 and v2. Type: string (or Expression with resultType string). + public DataFactoryElement DriverVersion { get; set; } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.Serialization.cs index 96740c517adf..1bc9a2b04b85 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.Serialization.cs @@ -26,7 +26,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(ReadBehavior)) { writer.WritePropertyName("readBehavior"u8); - writer.WriteStringValue(ReadBehavior.Value.ToString()); + JsonSerializer.Serialize(writer, ReadBehavior); } if (Optional.IsDefined(AdditionalColumns)) { @@ -78,7 +78,7 @@ internal static SalesforceServiceCloudSource DeserializeSalesforceServiceCloudSo return null; } Optional> query = default; - Optional readBehavior = default; + Optional> readBehavior = default; Optional additionalColumns = default; string type = default; Optional> sourceRetryCount = default; @@ -104,7 +104,7 @@ internal static SalesforceServiceCloudSource DeserializeSalesforceServiceCloudSo { continue; } - readBehavior = new SalesforceSourceReadBehavior(property.Value.GetString()); + readBehavior = JsonSerializer.Deserialize>(property.Value.GetRawText()); continue; } if (property.NameEquals("additionalColumns"u8)) @@ -160,7 +160,7 @@ internal static SalesforceServiceCloudSource DeserializeSalesforceServiceCloudSo additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new SalesforceServiceCloudSource(type, sourceRetryCount.Value, sourceRetryWait.Value, maxConcurrentConnections.Value, disableMetricsCollection.Value, additionalProperties, query.Value, Optional.ToNullable(readBehavior), additionalColumns.Value); + return new SalesforceServiceCloudSource(type, sourceRetryCount.Value, sourceRetryWait.Value, maxConcurrentConnections.Value, disableMetricsCollection.Value, additionalProperties, query.Value, readBehavior.Value, additionalColumns.Value); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.cs index 41ecc396fa64..680952bbca2f 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceServiceCloudSource.cs @@ -28,9 +28,9 @@ public SalesforceServiceCloudSource() /// If true, disable data store metrics collection. Default is false. Type: boolean (or Expression with resultType boolean). /// Additional Properties. /// Database query. Type: string (or Expression with resultType string). - /// The read behavior for the operation. Default is Query. + /// The read behavior for the operation. Default is Query. Allowed values: Query/QueryAll. Type: string (or Expression with resultType string). /// Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects). - internal SalesforceServiceCloudSource(string copySourceType, DataFactoryElement sourceRetryCount, DataFactoryElement sourceRetryWait, DataFactoryElement maxConcurrentConnections, DataFactoryElement disableMetricsCollection, IDictionary additionalProperties, DataFactoryElement query, SalesforceSourceReadBehavior? readBehavior, BinaryData additionalColumns) : base(copySourceType, sourceRetryCount, sourceRetryWait, maxConcurrentConnections, disableMetricsCollection, additionalProperties) + internal SalesforceServiceCloudSource(string copySourceType, DataFactoryElement sourceRetryCount, DataFactoryElement sourceRetryWait, DataFactoryElement maxConcurrentConnections, DataFactoryElement disableMetricsCollection, IDictionary additionalProperties, DataFactoryElement query, DataFactoryElement readBehavior, BinaryData additionalColumns) : base(copySourceType, sourceRetryCount, sourceRetryWait, maxConcurrentConnections, disableMetricsCollection, additionalProperties) { Query = query; ReadBehavior = readBehavior; @@ -40,8 +40,8 @@ internal SalesforceServiceCloudSource(string copySourceType, DataFactoryElement< /// Database query. Type: string (or Expression with resultType string). public DataFactoryElement Query { get; set; } - /// The read behavior for the operation. Default is Query. - public SalesforceSourceReadBehavior? ReadBehavior { get; set; } + /// The read behavior for the operation. Default is Query. Allowed values: Query/QueryAll. Type: string (or Expression with resultType string). + public DataFactoryElement ReadBehavior { get; set; } /// /// Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects). /// diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.Serialization.cs index e97db9755963..519b61a4da2e 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.Serialization.cs @@ -26,7 +26,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(ReadBehavior)) { writer.WritePropertyName("readBehavior"u8); - writer.WriteStringValue(ReadBehavior.Value.ToString()); + JsonSerializer.Serialize(writer, ReadBehavior); } if (Optional.IsDefined(QueryTimeout)) { @@ -83,7 +83,7 @@ internal static SalesforceSource DeserializeSalesforceSource(JsonElement element return null; } Optional> query = default; - Optional readBehavior = default; + Optional> readBehavior = default; Optional> queryTimeout = default; Optional additionalColumns = default; string type = default; @@ -110,7 +110,7 @@ internal static SalesforceSource DeserializeSalesforceSource(JsonElement element { continue; } - readBehavior = new SalesforceSourceReadBehavior(property.Value.GetString()); + readBehavior = JsonSerializer.Deserialize>(property.Value.GetRawText()); continue; } if (property.NameEquals("queryTimeout"u8)) @@ -175,7 +175,7 @@ internal static SalesforceSource DeserializeSalesforceSource(JsonElement element additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new SalesforceSource(type, sourceRetryCount.Value, sourceRetryWait.Value, maxConcurrentConnections.Value, disableMetricsCollection.Value, additionalProperties, queryTimeout.Value, additionalColumns.Value, query.Value, Optional.ToNullable(readBehavior)); + return new SalesforceSource(type, sourceRetryCount.Value, sourceRetryWait.Value, maxConcurrentConnections.Value, disableMetricsCollection.Value, additionalProperties, queryTimeout.Value, additionalColumns.Value, query.Value, readBehavior.Value); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.cs index 87e00bda596f..83803c0fec68 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSource.cs @@ -30,8 +30,8 @@ public SalesforceSource() /// Query timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). /// Specifies the additional columns to be added to source data. Type: array of objects(AdditionalColumns) (or Expression with resultType array of objects). /// Database query. Type: string (or Expression with resultType string). - /// The read behavior for the operation. Default is Query. - internal SalesforceSource(string copySourceType, DataFactoryElement sourceRetryCount, DataFactoryElement sourceRetryWait, DataFactoryElement maxConcurrentConnections, DataFactoryElement disableMetricsCollection, IDictionary additionalProperties, DataFactoryElement queryTimeout, BinaryData additionalColumns, DataFactoryElement query, SalesforceSourceReadBehavior? readBehavior) : base(copySourceType, sourceRetryCount, sourceRetryWait, maxConcurrentConnections, disableMetricsCollection, additionalProperties, queryTimeout, additionalColumns) + /// The read behavior for the operation. Default is Query. Allowed values: Query/QueryAll. Type: string (or Expression with resultType string). + internal SalesforceSource(string copySourceType, DataFactoryElement sourceRetryCount, DataFactoryElement sourceRetryWait, DataFactoryElement maxConcurrentConnections, DataFactoryElement disableMetricsCollection, IDictionary additionalProperties, DataFactoryElement queryTimeout, BinaryData additionalColumns, DataFactoryElement query, DataFactoryElement readBehavior) : base(copySourceType, sourceRetryCount, sourceRetryWait, maxConcurrentConnections, disableMetricsCollection, additionalProperties, queryTimeout, additionalColumns) { Query = query; ReadBehavior = readBehavior; @@ -40,7 +40,7 @@ internal SalesforceSource(string copySourceType, DataFactoryElement sourceR /// Database query. Type: string (or Expression with resultType string). public DataFactoryElement Query { get; set; } - /// The read behavior for the operation. Default is Query. - public SalesforceSourceReadBehavior? ReadBehavior { get; set; } + /// The read behavior for the operation. Default is Query. Allowed values: Query/QueryAll. Type: string (or Expression with resultType string). + public DataFactoryElement ReadBehavior { get; set; } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSourceReadBehavior.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSourceReadBehavior.cs deleted file mode 100644 index 79385fbdb011..000000000000 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SalesforceSourceReadBehavior.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DataFactory.Models -{ - /// The read behavior for the operation. Default is Query. - public readonly partial struct SalesforceSourceReadBehavior : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SalesforceSourceReadBehavior(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string QueryValue = "Query"; - private const string QueryAllValue = "QueryAll"; - - /// Query. - public static SalesforceSourceReadBehavior Query { get; } = new SalesforceSourceReadBehavior(QueryValue); - /// QueryAll. - public static SalesforceSourceReadBehavior QueryAll { get; } = new SalesforceSourceReadBehavior(QueryAllValue); - /// Determines if two values are the same. - public static bool operator ==(SalesforceSourceReadBehavior left, SalesforceSourceReadBehavior right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SalesforceSourceReadBehavior left, SalesforceSourceReadBehavior right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SalesforceSourceReadBehavior(string value) => new SalesforceSourceReadBehavior(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SalesforceSourceReadBehavior other && Equals(other); - /// - public bool Equals(SalesforceSourceReadBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.Serialization.cs new file mode 100644 index 000000000000..0056adb5f893 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataFactory.Models +{ + public partial class SecureInputOutputPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SecureInput)) + { + writer.WritePropertyName("secureInput"u8); + writer.WriteBooleanValue(SecureInput.Value); + } + if (Optional.IsDefined(SecureOutput)) + { + writer.WritePropertyName("secureOutput"u8); + writer.WriteBooleanValue(SecureOutput.Value); + } + writer.WriteEndObject(); + } + + internal static SecureInputOutputPolicy DeserializeSecureInputOutputPolicy(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional secureInput = default; + Optional secureOutput = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secureInput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureInput = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("secureOutput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureOutput = property.Value.GetBoolean(); + continue; + } + } + return new SecureInputOutputPolicy(Optional.ToNullable(secureInput), Optional.ToNullable(secureOutput)); + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.cs new file mode 100644 index 000000000000..3628126974de --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SecureInputOutputPolicy.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataFactory.Models +{ + /// Execution policy for an activity that supports secure input and output. + public partial class SecureInputOutputPolicy + { + /// Initializes a new instance of SecureInputOutputPolicy. + public SecureInputOutputPolicy() + { + } + + /// Initializes a new instance of SecureInputOutputPolicy. + /// When set to true, Input from activity is considered as secure and will not be logged to monitoring. + /// When set to true, Output from activity is considered as secure and will not be logged to monitoring. + internal SecureInputOutputPolicy(bool? secureInput, bool? secureOutput) + { + SecureInput = secureInput; + SecureOutput = secureOutput; + } + + /// When set to true, Input from activity is considered as secure and will not be logged to monitoring. + public bool? SecureInput { get; set; } + /// When set to true, Output from activity is considered as secure and will not be logged to monitoring. + public bool? SecureOutput { get; set; } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.Serialization.cs index 625f44cb2644..13ab184c26f9 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.Serialization.cs @@ -18,6 +18,11 @@ public partial class SetVariableActivity : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); + if (Optional.IsDefined(Policy)) + { + writer.WritePropertyName("policy"u8); + writer.WriteObjectValue(Policy); + } writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); @@ -93,6 +98,7 @@ internal static SetVariableActivity DeserializeSetVariableActivity(JsonElement e { return null; } + Optional policy = default; string name = default; string type = default; Optional description = default; @@ -107,6 +113,15 @@ internal static SetVariableActivity DeserializeSetVariableActivity(JsonElement e Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("policy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policy = SecureInputOutputPolicy.DeserializeSecureInputOutputPolicy(property.Value); + continue; + } if (property.NameEquals("name"u8)) { name = property.Value.GetString(); @@ -206,7 +221,7 @@ internal static SetVariableActivity DeserializeSetVariableActivity(JsonElement e additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new SetVariableActivity(name, type, description.Value, Optional.ToNullable(state), Optional.ToNullable(onInactiveMarkAs), Optional.ToList(dependsOn), Optional.ToList(userProperties), additionalProperties, variableName.Value, value.Value, Optional.ToNullable(setSystemVariable)); + return new SetVariableActivity(name, type, description.Value, Optional.ToNullable(state), Optional.ToNullable(onInactiveMarkAs), Optional.ToList(dependsOn), Optional.ToList(userProperties), additionalProperties, policy.Value, variableName.Value, value.Value, Optional.ToNullable(setSystemVariable)); } } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.cs index 59f76e7ce727..e0f89650aba2 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/SetVariableActivity.cs @@ -34,17 +34,21 @@ public SetVariableActivity(string name) : base(name) /// Activity depends on condition. /// Activity user properties. /// Additional Properties. + /// Activity policy. /// Name of the variable whose value needs to be set. /// Value to be set. Could be a static value or Expression. /// If set to true, it sets the pipeline run return value. - internal SetVariableActivity(string name, string activityType, string description, ActivityState? state, ActivityOnInactiveMarkA? onInactiveMarkAs, IList dependsOn, IList userProperties, IDictionary additionalProperties, string variableName, DataFactoryElement value, bool? setSystemVariable) : base(name, activityType, description, state, onInactiveMarkAs, dependsOn, userProperties, additionalProperties) + internal SetVariableActivity(string name, string activityType, string description, ActivityState? state, ActivityOnInactiveMarkA? onInactiveMarkAs, IList dependsOn, IList userProperties, IDictionary additionalProperties, SecureInputOutputPolicy policy, string variableName, DataFactoryElement value, bool? setSystemVariable) : base(name, activityType, description, state, onInactiveMarkAs, dependsOn, userProperties, additionalProperties) { + Policy = policy; VariableName = variableName; Value = value; SetSystemVariable = setSystemVariable; ActivityType = activityType ?? "SetVariable"; } + /// Activity policy. + public SecureInputOutputPolicy Policy { get; set; } /// Name of the variable whose value needs to be set. public string VariableName { get; set; } /// Value to be set. Could be a static value or Expression. diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/RestOperations/ChangeDataCaptureRestOperations.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/RestOperations/ChangeDataCaptureRestOperations.cs new file mode 100644 index 000000000000..699b37585763 --- /dev/null +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/RestOperations/ChangeDataCaptureRestOperations.cs @@ -0,0 +1,698 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DataFactory.Models; + +namespace Azure.ResourceManager.DataFactory +{ + internal partial class ChangeDataCaptureRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ChangeDataCaptureRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ChangeDataCaptureRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2018-06-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByFactoryRequest(string subscriptionId, string resourceGroupName, string factoryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all resources of type change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFactoryAsync(string subscriptionId, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + + using var message = CreateListByFactoryRequest(subscriptionId, resourceGroupName, factoryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ChangeDataCaptureListResponse.DeserializeChangeDataCaptureListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all resources of type change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFactory(string subscriptionId, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + + using var message = CreateListByFactoryRequest(subscriptionId, resourceGroupName, factoryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ChangeDataCaptureListResponse.DeserializeChangeDataCaptureListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, ChangeDataCaptureResourceData data, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a change data capture resource. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName, data, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a change data capture resource. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// Change data capture resource definition. + /// ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, ChangeDataCaptureResourceData data, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName, data, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ChangeDataCaptureResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ChangeDataCaptureResourceData.DeserializeChangeDataCaptureResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ChangeDataCaptureResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Starts a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Stops a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops a change data capture. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStatusRequest(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataFactory/factories/", false); + uri.AppendPath(factoryName, true); + uri.AppendPath("/adfcdcs/", false); + uri.AppendPath(changeDataCaptureName, true); + uri.AppendPath("/status", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the current status for the change data capture resource. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> StatusAsync(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStatusRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the current status for the change data capture resource. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The change data capture name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Status(string subscriptionId, string resourceGroupName, string factoryName, string changeDataCaptureName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + Argument.AssertNotNullOrEmpty(changeDataCaptureName, nameof(changeDataCaptureName)); + + using var message = CreateStatusRequest(subscriptionId, resourceGroupName, factoryName, changeDataCaptureName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByFactoryNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string factoryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all resources of type change data capture. + /// The URL to the next page of results. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFactoryNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + + using var message = CreateListByFactoryNextPageRequest(nextLink, subscriptionId, resourceGroupName, factoryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ChangeDataCaptureListResponse.DeserializeChangeDataCaptureListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all resources of type change data capture. + /// The URL to the next page of results. + /// The subscription identifier. + /// The resource group name. + /// The factory name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFactoryNextPage(string nextLink, string subscriptionId, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(factoryName, nameof(factoryName)); + + using var message = CreateListByFactoryNextPageRequest(nextLink, subscriptionId, resourceGroupName, factoryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ChangeDataCaptureListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ChangeDataCaptureListResponse.DeserializeChangeDataCaptureListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md index 5b86ca164eb4..05c23f34a153 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: DataFactory namespace: Azure.ResourceManager.DataFactory -require: https://github.com/Azure/azure-rest-api-specs/blob/cd06d327e115cdb55f8e7c9fd1b23fa551b5b750/specification/datafactory/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true