diff --git a/generated/DataTransfer/DataTransfer.Autorest/Properties/AssemblyInfo.cs b/generated/DataTransfer/DataTransfer.Autorest/Properties/AssemblyInfo.cs index d4a6cb587ded..be468e2f513f 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/Properties/AssemblyInfo.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataTransfer")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("2.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("2.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/DataTransfer/DataTransfer.Autorest/exports/Get-AzDataTransferFlowProfile.ps1 b/generated/DataTransfer/DataTransfer.Autorest/exports/Get-AzDataTransferFlowProfile.ps1 index 6a03d3a56071..dc76e049e002 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/exports/Get-AzDataTransferFlowProfile.ps1 +++ b/generated/DataTransfer/DataTransfer.Autorest/exports/Get-AzDataTransferFlowProfile.ps1 @@ -31,7 +31,7 @@ ADT.Models.IListFlowProfilesRequest .Outputs ADT.Models.IFlowProfile .Outputs -ADT.Models.IFlowProfileMetadata +ADT.Models.IFlowProfilesListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -61,7 +61,7 @@ PIPELINEINPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datatransfer/get-azdatatransferflowprofile #> function Get-AzDataTransferFlowProfile { -[OutputType([ADT.Models.IFlowProfile], [ADT.Models.IFlowProfileMetadata])] +[OutputType([ADT.Models.IFlowProfile], [ADT.Models.IFlowProfilesListResult])] [CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] diff --git a/generated/DataTransfer/DataTransfer.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/DataTransfer/DataTransfer.Autorest/exports/ProxyCmdletDefinitions.ps1 index 14e3e49dceb1..b1d70b83c69f 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/DataTransfer/DataTransfer.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -1275,7 +1275,7 @@ ADT.Models.IListFlowProfilesRequest .Outputs ADT.Models.IFlowProfile .Outputs -ADT.Models.IFlowProfileMetadata +ADT.Models.IFlowProfilesListResult .Notes COMPLEX PARAMETER PROPERTIES @@ -1305,7 +1305,7 @@ PIPELINEINPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.datatransfer/get-azdatatransferflowprofile #> function Get-AzDataTransferFlowProfile { -[OutputType([ADT.Models.IFlowProfile], [ADT.Models.IFlowProfileMetadata])] +[OutputType([ADT.Models.IFlowProfile], [ADT.Models.IFlowProfilesListResult])] [CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] diff --git a/generated/DataTransfer/DataTransfer.Autorest/generate-info.json b/generated/DataTransfer/DataTransfer.Autorest/generate-info.json index f028b6e5e53f..df0526505424 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generate-info.json +++ b/generated/DataTransfer/DataTransfer.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "20609426-b92c-4807-a758-9ab12ecd2318" + "generate_Id": "87d32e10-daae-4ed4-bd86-53b195130622" } diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/api/DataTransfer.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/api/DataTransfer.cs index 11e4b25bc349..9e2aee990b36 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generated/api/DataTransfer.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/api/DataTransfer.cs @@ -25,7 +25,7 @@ public partial class DataTransfer /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfiles(ADT.Models.IListFlowProfilesRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfiles(ADT.Models.IListFlowProfilesRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -67,7 +67,7 @@ public partial class DataTransfer /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaIdentity(global::System.String viaIdentity, ADT.Models.IListFlowProfilesRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaIdentity(global::System.String viaIdentity, ADT.Models.IListFlowProfilesRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -113,10 +113,10 @@ public partial class DataTransfer /// an instance of an ADT.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A - /// that will be complete when handling of the response is completed. + /// A that will be complete when handling + /// of the response is completed. /// - public async global::System.Threading.Tasks.Task> AzureDataTransferListFlowProfilesViaIdentityWithResult(global::System.String viaIdentity, ADT.Models.IListFlowProfilesRequest body, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaIdentityWithResult(global::System.String viaIdentity, ADT.Models.IListFlowProfilesRequest body, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -165,7 +165,7 @@ public partial class DataTransfer /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaJsonString(global::System.String jsonString, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -200,10 +200,10 @@ public partial class DataTransfer /// an instance that will receive events. /// an instance of an ADT.Runtime.ISendAsync pipeline to use to make the request. /// - /// A - /// that will be complete when handling of the response is completed. + /// A that will be complete when handling + /// of the response is completed. /// - public async global::System.Threading.Tasks.Task> AzureDataTransferListFlowProfilesViaJsonStringWithResult(global::System.String jsonString, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesViaJsonStringWithResult(global::System.String jsonString, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -239,10 +239,10 @@ public partial class DataTransfer /// an instance of an ADT.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A - /// that will be complete when handling of the response is completed. + /// A that will be complete when handling + /// of the response is completed. /// - public async global::System.Threading.Tasks.Task> AzureDataTransferListFlowProfilesWithResult(ADT.Models.IListFlowProfilesRequest body, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesWithResult(ADT.Models.IListFlowProfilesRequest body, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender, ADT.Runtime.SerializationMode serializationMode = ADT.Runtime.SerializationMode.IncludeCreate|ADT.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-05-30-preview"; // Constant Parameters @@ -279,10 +279,10 @@ public partial class DataTransfer /// an instance that will receive events. /// an instance of an ADT.Runtime.ISendAsync pipeline to use to make the request. /// - /// A - /// that will be complete when handling of the response is completed. + /// A that will be complete when handling + /// of the response is completed. /// - internal async global::System.Threading.Tasks.Task> AzureDataTransferListFlowProfilesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfilesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -301,7 +301,7 @@ public partial class DataTransfer case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(ADT.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => If( ADT.Runtime.Json.JsonArray.Parse(body.Result) as ADT.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(ADT.Models.IFlowProfileMetadata) (ADT.Models.FlowProfileMetadata.FromJson(__x) )) ))() : null); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => ADT.Models.FlowProfilesListResult.FromJson(ADT.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -344,7 +344,7 @@ public partial class DataTransfer /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfiles_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureDataTransferListFlowProfiles_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, ADT.Runtime.IEventListener eventListener, ADT.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -363,7 +363,7 @@ public partial class DataTransfer case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(ADT.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( ADT.Runtime.Json.JsonArray.Parse(body.Result) as ADT.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(ADT.Models.IFlowProfileMetadata) (ADT.Models.FlowProfileMetadata.FromJson(__x) )) ))() : null)); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => ADT.Models.FlowProfilesListResult.FromJson(ADT.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.PowerShell.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.PowerShell.cs new file mode 100644 index 000000000000..eb3abc0a3a7a --- /dev/null +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace ADT.Models +{ + using ADT.Runtime.PowerShell; + + /// The flow profiles list result + [System.ComponentModel.TypeConverter(typeof(FlowProfilesListResultTypeConverter))] + public partial class FlowProfilesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// an instance of . + public static ADT.Models.IFlowProfilesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FlowProfilesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// an instance of . + public static ADT.Models.IFlowProfilesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FlowProfilesListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FlowProfilesListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((ADT.Models.IFlowProfilesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((ADT.Models.IFlowProfilesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, ADT.Models.FlowProfileMetadataTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FlowProfilesListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((ADT.Models.IFlowProfilesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((ADT.Models.IFlowProfilesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, ADT.Models.FlowProfileMetadataTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static ADT.Models.IFlowProfilesListResult FromJsonString(string jsonText) => FromJson(ADT.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, ADT.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The flow profiles list result + [System.ComponentModel.TypeConverter(typeof(FlowProfilesListResultTypeConverter))] + public partial interface IFlowProfilesListResult + + { + + } +} \ No newline at end of file diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.TypeConverter.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.TypeConverter.cs new file mode 100644 index 000000000000..676389e9784d --- /dev/null +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace ADT.Models +{ + using ADT.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FlowProfilesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && ADT.Runtime.Json.JsonNode.Parse(text).Type == ADT.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static ADT.Models.IFlowProfilesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(ADT.Models.IFlowProfilesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FlowProfilesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FlowProfilesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FlowProfilesListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.cs new file mode 100644 index 000000000000..9769d739a9dd --- /dev/null +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace ADT.Models +{ + using static ADT.Runtime.Extensions; + + /// The flow profiles list result + public partial class FlowProfilesListResult : + ADT.Models.IFlowProfilesListResult, + ADT.Models.IFlowProfilesListResultInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// FlowProfileMetadata array. + [ADT.Origin(ADT.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public FlowProfilesListResult() + { + + } + } + /// The flow profiles list result + public partial interface IFlowProfilesListResult : + ADT.Runtime.IJsonSerializable + { + /// FlowProfileMetadata array. + [ADT.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"FlowProfileMetadata array.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(ADT.Models.IFlowProfileMetadata) })] + System.Collections.Generic.List Value { get; set; } + + } + /// The flow profiles list result + internal partial interface IFlowProfilesListResultInternal + + { + /// FlowProfileMetadata array. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.json.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.json.cs new file mode 100644 index 000000000000..282982dfd57b --- /dev/null +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/api/Models/FlowProfilesListResult.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace ADT.Models +{ + using static ADT.Runtime.Extensions; + + /// The flow profiles list result + public partial class FlowProfilesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(ADT.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref ADT.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(ADT.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref ADT.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a ADT.Runtime.Json.JsonObject into a new instance of . + /// + /// A ADT.Runtime.Json.JsonObject instance to deserialize from. + internal FlowProfilesListResult(ADT.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as ADT.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(ADT.Models.IFlowProfileMetadata) (ADT.Models.FlowProfileMetadata.FromJson(__u) )) ))() : null : _value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of ADT.Models.IFlowProfilesListResult. + /// + /// a to deserialize from. + /// an instance of ADT.Models.IFlowProfilesListResult. + public static ADT.Models.IFlowProfilesListResult FromJson(ADT.Runtime.Json.JsonNode node) + { + return node is ADT.Runtime.Json.JsonObject json ? new FlowProfilesListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public ADT.Runtime.Json.JsonNode ToJson(ADT.Runtime.Json.JsonObject container, ADT.Runtime.SerializationMode serializationMode) + { + container = container ?? new ADT.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new ADT.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_List.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_List.cs index d7f000c7eeeb..057adcc005fa 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_List.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_List.cs @@ -15,7 +15,7 @@ namespace ADT.Cmdlets /// [OpenAPI] ListFlowProfiles=>POST:"/providers/Microsoft.AzureDataTransfer/listFlowProfiles" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataTransferFlowProfile_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfileMetadata))] + [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfilesListResult))] [global::ADT.Description(@"Retrieves a list of FlowProfile resources associated with a specified pipeline.")] [global::ADT.Generated] [global::ADT.HttpPath(Path = "/providers/Microsoft.AzureDataTransfer/listFlowProfiles", ApiVersion = "2025-05-30-preview")] @@ -150,12 +150,12 @@ public partial class GetAzDataTransferFlowProfile_List : global::System.Manageme /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -433,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,15 +450,15 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be System.Collections.Generic.List + // (await response) // should be ADT.Models.IFlowProfilesListResult var result = (await response); // response should be returning an array of some kind. +Pageable - // array / / - if (null != result) + // nested-array / value / + if (null != result.Value) { - if (0 == _responseSize && 1 == result.Count) + if (0 == _responseSize && 1 == result.Value.Count) { - _firstResponse = result[0]; + _firstResponse = result.Value[0]; _responseSize = 1; } else @@ -469,7 +469,7 @@ protected override void StopProcessing() WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } var values = new System.Collections.Generic.List(); - foreach( var value in result ) + foreach( var value in result.Value ) { values.Add(value.AddMultipleTypeNameIntoPSObject()); } diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListExpanded.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListExpanded.cs index 2a383553bcda..857ebc7c6cd6 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListExpanded.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListExpanded.cs @@ -15,7 +15,7 @@ namespace ADT.Cmdlets /// [OpenAPI] ListFlowProfiles=>POST:"/providers/Microsoft.AzureDataTransfer/listFlowProfiles" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataTransferFlowProfile_ListExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfileMetadata))] + [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfilesListResult))] [global::ADT.Description(@"Retrieves a list of FlowProfile resources associated with a specified pipeline.")] [global::ADT.Generated] [global::ADT.HttpPath(Path = "/providers/Microsoft.AzureDataTransfer/listFlowProfiles", ApiVersion = "2025-05-30-preview")] @@ -150,12 +150,12 @@ public partial class GetAzDataTransferFlowProfile_ListExpanded : global::System. /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -433,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,15 +450,15 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be System.Collections.Generic.List + // (await response) // should be ADT.Models.IFlowProfilesListResult var result = (await response); // response should be returning an array of some kind. +Pageable - // array / / - if (null != result) + // nested-array / value / + if (null != result.Value) { - if (0 == _responseSize && 1 == result.Count) + if (0 == _responseSize && 1 == result.Value.Count) { - _firstResponse = result[0]; + _firstResponse = result.Value[0]; _responseSize = 1; } else @@ -469,7 +469,7 @@ protected override void StopProcessing() WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } var values = new System.Collections.Generic.List(); - foreach( var value in result ) + foreach( var value in result.Value ) { values.Add(value.AddMultipleTypeNameIntoPSObject()); } diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonFilePath.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonFilePath.cs index 9d6641784a77..d9c5ea1b004f 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonFilePath.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonFilePath.cs @@ -15,7 +15,7 @@ namespace ADT.Cmdlets /// [OpenAPI] ListFlowProfiles=>POST:"/providers/Microsoft.AzureDataTransfer/listFlowProfiles" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataTransferFlowProfile_ListViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfileMetadata))] + [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfilesListResult))] [global::ADT.Description(@"Retrieves a list of FlowProfile resources associated with a specified pipeline.")] [global::ADT.Generated] [global::ADT.HttpPath(Path = "/providers/Microsoft.AzureDataTransfer/listFlowProfiles", ApiVersion = "2025-05-30-preview")] @@ -150,12 +150,12 @@ public partial class GetAzDataTransferFlowProfile_ListViaJsonFilePath : global:: /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -433,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -450,15 +450,15 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be System.Collections.Generic.List + // (await response) // should be ADT.Models.IFlowProfilesListResult var result = (await response); // response should be returning an array of some kind. +Pageable - // array / / - if (null != result) + // nested-array / value / + if (null != result.Value) { - if (0 == _responseSize && 1 == result.Count) + if (0 == _responseSize && 1 == result.Value.Count) { - _firstResponse = result[0]; + _firstResponse = result.Value[0]; _responseSize = 1; } else @@ -469,7 +469,7 @@ protected override void StopProcessing() WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } var values = new System.Collections.Generic.List(); - foreach( var value in result ) + foreach( var value in result.Value ) { values.Add(value.AddMultipleTypeNameIntoPSObject()); } diff --git a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonString.cs b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonString.cs index ea273963217d..15db2403994d 100644 --- a/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonString.cs +++ b/generated/DataTransfer/DataTransfer.Autorest/generated/cmdlets/GetAzDataTransferFlowProfile_ListViaJsonString.cs @@ -15,7 +15,7 @@ namespace ADT.Cmdlets /// [OpenAPI] ListFlowProfiles=>POST:"/providers/Microsoft.AzureDataTransfer/listFlowProfiles" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDataTransferFlowProfile_ListViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfileMetadata))] + [global::System.Management.Automation.OutputType(typeof(ADT.Models.IFlowProfilesListResult))] [global::ADT.Description(@"Retrieves a list of FlowProfile resources associated with a specified pipeline.")] [global::ADT.Generated] [global::ADT.HttpPath(Path = "/providers/Microsoft.AzureDataTransfer/listFlowProfiles", ApiVersion = "2025-05-30-preview")] @@ -148,12 +148,12 @@ public partial class GetAzDataTransferFlowProfile_ListViaJsonString : global::Sy /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -431,12 +431,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a System.Collections.Generic.List + /// the body result as a ADT.Models.IFlowProfilesListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +448,15 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be System.Collections.Generic.List + // (await response) // should be ADT.Models.IFlowProfilesListResult var result = (await response); // response should be returning an array of some kind. +Pageable - // array / / - if (null != result) + // nested-array / value / + if (null != result.Value) { - if (0 == _responseSize && 1 == result.Count) + if (0 == _responseSize && 1 == result.Value.Count) { - _firstResponse = result[0]; + _firstResponse = result.Value[0]; _responseSize = 1; } else @@ -467,7 +467,7 @@ protected override void StopProcessing() WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } var values = new System.Collections.Generic.List(); - foreach( var value in result ) + foreach( var value in result.Value ) { values.Add(value.AddMultipleTypeNameIntoPSObject()); }