From 35a451e8fdeeb744208c185dfa42ccf33427a290 Mon Sep 17 00:00:00 2001 From: Danial Shakeri Date: Sun, 8 Oct 2017 21:29:29 -0700 Subject: [PATCH] Updating sdk with latest hyak --- .../Generated/AutomationManagementClient.cs | 10 +- .../Generated/DscNodeOperations.cs | 167 ++++++++---------- .../HybridRunbookWorkerGroupOperations.cs | 16 +- ...dRunbookWorkerGroupOperationsExtensions.cs | 16 +- .../IHybridRunbookWorkerGroupOperations.cs | 6 +- .../HybridRunbookWorkerGroupListParameters.cs | 53 ++++++ .../Models/HybridRunbookWorkerGroupType.cs | 36 ++++ 7 files changed, 199 insertions(+), 105 deletions(-) create mode 100644 src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupListParameters.cs create mode 100644 src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupType.cs diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/AutomationManagementClient.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/AutomationManagementClient.cs index 55aa9aa7b929..35bc07e02ee7 100644 --- a/src/ResourceManagement/Automation/AutomationManagement/Generated/AutomationManagementClient.cs +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/AutomationManagementClient.cs @@ -800,23 +800,23 @@ public async Task GetOperationResultStatusAs { result.RequestId = httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - if (statusCode == HttpStatusCode.BadRequest) + if (statusCode == HttpStatusCode.NotFound) { result.Status = OperationStatus.Failed; } - if (statusCode == HttpStatusCode.NotFound) + if (statusCode == HttpStatusCode.BadRequest) { result.Status = OperationStatus.Failed; } - if (statusCode == HttpStatusCode.NoContent) + if (statusCode == HttpStatusCode.OK) { result.Status = OperationStatus.Succeeded; } - if (statusCode == HttpStatusCode.OK) + if (statusCode == HttpStatusCode.Created) { result.Status = OperationStatus.Succeeded; } - if (statusCode == HttpStatusCode.Created) + if (statusCode == HttpStatusCode.NoContent) { result.Status = OperationStatus.Succeeded; } diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/DscNodeOperations.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/DscNodeOperations.cs index a30b412fd062..f95a93b224c2 100644 --- a/src/ResourceManagement/Automation/AutomationManagement/Generated/DscNodeOperations.cs +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/DscNodeOperations.cs @@ -33,7 +33,6 @@ using Microsoft.Azure; using Microsoft.Azure.Management.Automation; using Microsoft.Azure.Management.Automation.Models; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Microsoft.Azure.Management.Automation @@ -408,33 +407,28 @@ public async Task GetAsync(string resourceGroupName, string nodeConfigurationInstance.Name = nameInstance; } } - - IEnumerable extensionHandlerList = responseDoc["extensionHandler"].Children(); - if (extensionHandlerList != null) + + JToken extensionHandlerArray = responseDoc["extensionHandler"]; + if (extensionHandlerArray != null && extensionHandlerArray.Type != JTokenType.Null) { - IList extensionHandlerListInstance = - new List(); - nodeInstance.ExtensionHandler = extensionHandlerListInstance; - - foreach (JToken extensionHandler in extensionHandlerList) + foreach (JToken extensionHandlerValue in ((JArray)extensionHandlerArray)) { - DscNodeExtensionHandlerAssociationProperty extensionHandlerInstance = new DscNodeExtensionHandlerAssociationProperty(); - - JToken nameValue = extensionHandler["name"]; - if (nameValue != null && nameValue.Type != JTokenType.Null) + DscNodeExtensionHandlerAssociationProperty dscNodeExtensionHandlerAssociationPropertyInstance = new DscNodeExtensionHandlerAssociationProperty(); + nodeInstance.ExtensionHandler.Add(dscNodeExtensionHandlerAssociationPropertyInstance); + + JToken nameValue2 = extensionHandlerValue["name"]; + if (nameValue2 != null && nameValue2.Type != JTokenType.Null) { - string nameInstance = ((string)nameValue); - extensionHandlerInstance.Name = nameInstance; + string nameInstance2 = ((string)nameValue2); + dscNodeExtensionHandlerAssociationPropertyInstance.Name = nameInstance2; } - - JToken versionValue = extensionHandler["version"]; + + JToken versionValue = extensionHandlerValue["version"]; if (versionValue != null && versionValue.Type != JTokenType.Null) { string versionInstance = ((string)versionValue); - extensionHandlerInstance.Version = versionInstance; + dscNodeExtensionHandlerAssociationPropertyInstance.Version = versionInstance; } - - extensionHandlerListInstance.Add(extensionHandlerInstance); } } @@ -459,11 +453,11 @@ public async Task GetAsync(string resourceGroupName, string nodeInstance.Id = idInstance; } - JToken nameValue2 = responseDoc["name"]; - if (nameValue2 != null && nameValue2.Type != JTokenType.Null) + JToken nameValue3 = responseDoc["name"]; + if (nameValue3 != null && nameValue3.Type != JTokenType.Null) { - string nameInstance2 = ((string)nameValue2); - nodeInstance.Name = nameInstance2; + string nameInstance3 = ((string)nameValue3); + nodeInstance.Name = nameInstance3; } JToken locationValue = responseDoc["location"]; @@ -735,36 +729,31 @@ public async Task ListAsync(string resourceGroupName, strin nodeConfigurationInstance.Name = nameInstance; } } - - IEnumerable extensionHandlerList = valueValue["extensionHandler"].Children(); - if (extensionHandlerList != null) + + JToken extensionHandlerArray = valueValue["extensionHandler"]; + if (extensionHandlerArray != null && extensionHandlerArray.Type != JTokenType.Null) { - IList extensionHandlerListInstance = - new List(); - dscNodeInstance.ExtensionHandler = extensionHandlerListInstance; - - foreach (JToken extensionHandler in extensionHandlerList) + foreach (JToken extensionHandlerValue in ((JArray)extensionHandlerArray)) { - DscNodeExtensionHandlerAssociationProperty extensionHandlerInstance = new DscNodeExtensionHandlerAssociationProperty(); - - JToken nameValue = extensionHandler["name"]; - if (nameValue != null && nameValue.Type != JTokenType.Null) + DscNodeExtensionHandlerAssociationProperty dscNodeExtensionHandlerAssociationPropertyInstance = new DscNodeExtensionHandlerAssociationProperty(); + dscNodeInstance.ExtensionHandler.Add(dscNodeExtensionHandlerAssociationPropertyInstance); + + JToken nameValue2 = extensionHandlerValue["name"]; + if (nameValue2 != null && nameValue2.Type != JTokenType.Null) { - string nameInstance = ((string)nameValue); - extensionHandlerInstance.Name = nameInstance; + string nameInstance2 = ((string)nameValue2); + dscNodeExtensionHandlerAssociationPropertyInstance.Name = nameInstance2; } - - JToken versionValue = extensionHandler["version"]; + + JToken versionValue = extensionHandlerValue["version"]; if (versionValue != null && versionValue.Type != JTokenType.Null) { string versionInstance = ((string)versionValue); - extensionHandlerInstance.Version = versionInstance; + dscNodeExtensionHandlerAssociationPropertyInstance.Version = versionInstance; } - - extensionHandlerListInstance.Add(extensionHandlerInstance); } } - + JToken statusValue = valueValue["status"]; if (statusValue != null && statusValue.Type != JTokenType.Null) { @@ -786,11 +775,11 @@ public async Task ListAsync(string resourceGroupName, strin dscNodeInstance.Id = idInstance; } - JToken nameValue2 = valueValue["name"]; - if (nameValue2 != null && nameValue2.Type != JTokenType.Null) + JToken nameValue3 = valueValue["name"]; + if (nameValue3 != null && nameValue3.Type != JTokenType.Null) { - string nameInstance2 = ((string)nameValue2); - dscNodeInstance.Name = nameInstance2; + string nameInstance3 = ((string)nameValue3); + dscNodeInstance.Name = nameInstance3; } JToken locationValue = valueValue["location"]; @@ -1018,33 +1007,28 @@ public async Task ListNextAsync(string nextLink, Cancellati nodeConfigurationInstance.Name = nameInstance; } } - - IEnumerable extensionHandlerList = valueValue["extensionHandler"].Children(); - if (extensionHandlerList != null) + + JToken extensionHandlerArray = valueValue["extensionHandler"]; + if (extensionHandlerArray != null && extensionHandlerArray.Type != JTokenType.Null) { - IList extensionHandlerListInstance = - new List(); - dscNodeInstance.ExtensionHandler = extensionHandlerListInstance; - - foreach (JToken extensionHandler in extensionHandlerList) + foreach (JToken extensionHandlerValue in ((JArray)extensionHandlerArray)) { - DscNodeExtensionHandlerAssociationProperty extensionHandlerInstance = new DscNodeExtensionHandlerAssociationProperty(); - - JToken nameValue = extensionHandler["name"]; - if (nameValue != null && nameValue.Type != JTokenType.Null) + DscNodeExtensionHandlerAssociationProperty dscNodeExtensionHandlerAssociationPropertyInstance = new DscNodeExtensionHandlerAssociationProperty(); + dscNodeInstance.ExtensionHandler.Add(dscNodeExtensionHandlerAssociationPropertyInstance); + + JToken nameValue2 = extensionHandlerValue["name"]; + if (nameValue2 != null && nameValue2.Type != JTokenType.Null) { - string nameInstance = ((string)nameValue); - extensionHandlerInstance.Name = nameInstance; + string nameInstance2 = ((string)nameValue2); + dscNodeExtensionHandlerAssociationPropertyInstance.Name = nameInstance2; } - - JToken versionValue = extensionHandler["version"]; + + JToken versionValue = extensionHandlerValue["version"]; if (versionValue != null && versionValue.Type != JTokenType.Null) { string versionInstance = ((string)versionValue); - extensionHandlerInstance.Version = versionInstance; + dscNodeExtensionHandlerAssociationPropertyInstance.Version = versionInstance; } - - extensionHandlerListInstance.Add(extensionHandlerInstance); } } @@ -1069,11 +1053,11 @@ public async Task ListNextAsync(string nextLink, Cancellati dscNodeInstance.Id = idInstance; } - JToken nameValue2 = valueValue["name"]; - if (nameValue2 != null && nameValue2.Type != JTokenType.Null) + JToken nameValue3 = valueValue["name"]; + if (nameValue3 != null && nameValue3.Type != JTokenType.Null) { - string nameInstance2 = ((string)nameValue2); - dscNodeInstance.Name = nameInstance2; + string nameInstance3 = ((string)nameValue3); + dscNodeInstance.Name = nameInstance3; } JToken locationValue = valueValue["location"]; @@ -1369,33 +1353,28 @@ public async Task PatchAsync(string resourceGroupName, str nodeConfigurationInstance.Name = nameInstance; } } - - IEnumerable extensionHandlerList = responseDoc["extensionHandler"].Children(); - if (extensionHandlerList != null) + + JToken extensionHandlerArray = responseDoc["extensionHandler"]; + if (extensionHandlerArray != null && extensionHandlerArray.Type != JTokenType.Null) { - IList extensionHandlerListInstance = - new List(); - nodeInstance.ExtensionHandler = extensionHandlerListInstance; - - foreach (JToken extensionHandler in extensionHandlerList) + foreach (JToken extensionHandlerValue in ((JArray)extensionHandlerArray)) { - DscNodeExtensionHandlerAssociationProperty extensionHandlerInstance = new DscNodeExtensionHandlerAssociationProperty(); - - JToken nameValue = extensionHandler["name"]; - if (nameValue != null && nameValue.Type != JTokenType.Null) + DscNodeExtensionHandlerAssociationProperty dscNodeExtensionHandlerAssociationPropertyInstance = new DscNodeExtensionHandlerAssociationProperty(); + nodeInstance.ExtensionHandler.Add(dscNodeExtensionHandlerAssociationPropertyInstance); + + JToken nameValue2 = extensionHandlerValue["name"]; + if (nameValue2 != null && nameValue2.Type != JTokenType.Null) { - string nameInstance = ((string)nameValue); - extensionHandlerInstance.Name = nameInstance; + string nameInstance2 = ((string)nameValue2); + dscNodeExtensionHandlerAssociationPropertyInstance.Name = nameInstance2; } - - JToken versionValue = extensionHandler["version"]; + + JToken versionValue = extensionHandlerValue["version"]; if (versionValue != null && versionValue.Type != JTokenType.Null) { string versionInstance = ((string)versionValue); - extensionHandlerInstance.Version = versionInstance; + dscNodeExtensionHandlerAssociationPropertyInstance.Version = versionInstance; } - - extensionHandlerListInstance.Add(extensionHandlerInstance); } } @@ -1420,11 +1399,11 @@ public async Task PatchAsync(string resourceGroupName, str nodeInstance.Id = idInstance; } - JToken nameValue2 = responseDoc["name"]; - if (nameValue2 != null && nameValue2.Type != JTokenType.Null) + JToken nameValue3 = responseDoc["name"]; + if (nameValue3 != null && nameValue3.Type != JTokenType.Null) { - string nameInstance2 = ((string)nameValue2); - nodeInstance.Name = nameInstance2; + string nameInstance3 = ((string)nameValue3); + nodeInstance.Name = nameInstance3; } JToken locationValue = responseDoc["location"]; diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperations.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperations.cs index 1454320a5da7..4538e17713aa 100644 --- a/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperations.cs +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperations.cs @@ -492,13 +492,17 @@ public async Task GetAsync(string resourceG /// /// Required. The automation account name. /// + /// + /// Optional. The parameters supplied to the list job stream's stream + /// items operation. + /// /// /// Cancellation token. /// /// /// The response model for the list hybrid runbook worker groups. /// - public async Task ListAsync(string resourceGroupName, string automationAccount, CancellationToken cancellationToken) + public async Task ListAsync(string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters, CancellationToken cancellationToken) { // Validate if (resourceGroupName == null) @@ -519,6 +523,7 @@ public async Task ListAsync(string resour Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccount", automationAccount); + tracingParameters.Add("parameters", parameters); TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters); } @@ -540,6 +545,15 @@ public async Task ListAsync(string resour url = url + Uri.EscapeDataString(automationAccount); url = url + "/hybridRunbookWorkerGroups"; List queryParameters = new List(); + List odataFilter = new List(); + if (parameters != null && parameters.GroupType != null) + { + odataFilter.Add("groupType eq '" + Uri.EscapeDataString(parameters.GroupType) + "'"); + } + if (odataFilter.Count > 0) + { + queryParameters.Add("$filter=" + string.Join(null, odataFilter)); + } queryParameters.Add("api-version=2017-05-15-preview"); if (queryParameters.Count > 0) { diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs index 4ec3b754b244..0b3e2465b939 100644 --- a/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs @@ -162,14 +162,18 @@ public static Task GetAsync(this IHybridRun /// /// Required. The automation account name. /// + /// + /// Optional. The parameters supplied to the list job stream's stream + /// items operation. + /// /// /// The response model for the list hybrid runbook worker groups. /// - public static HybridRunbookWorkerGroupsListResponse List(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccount) + public static HybridRunbookWorkerGroupsListResponse List(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters) { return Task.Factory.StartNew((object s) => { - return ((IHybridRunbookWorkerGroupOperations)s).ListAsync(resourceGroupName, automationAccount); + return ((IHybridRunbookWorkerGroupOperations)s).ListAsync(resourceGroupName, automationAccount, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } @@ -189,12 +193,16 @@ public static HybridRunbookWorkerGroupsListResponse List(this IHybridRunbookWork /// /// Required. The automation account name. /// + /// + /// Optional. The parameters supplied to the list job stream's stream + /// items operation. + /// /// /// The response model for the list hybrid runbook worker groups. /// - public static Task ListAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccount) + public static Task ListAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters) { - return operations.ListAsync(resourceGroupName, automationAccount, CancellationToken.None); + return operations.ListAsync(resourceGroupName, automationAccount, parameters, CancellationToken.None); } /// diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/IHybridRunbookWorkerGroupOperations.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/IHybridRunbookWorkerGroupOperations.cs index 6b98efe7b7bd..6eb6bf43745a 100644 --- a/src/ResourceManagement/Automation/AutomationManagement/Generated/IHybridRunbookWorkerGroupOperations.cs +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/IHybridRunbookWorkerGroupOperations.cs @@ -92,13 +92,17 @@ public partial interface IHybridRunbookWorkerGroupOperations /// /// The automation account name. /// + /// + /// The parameters supplied to the list job stream's stream items + /// operation. + /// /// /// Cancellation token. /// /// /// The response model for the list hybrid runbook worker groups. /// - Task ListAsync(string resourceGroupName, string automationAccount, CancellationToken cancellationToken); + Task ListAsync(string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters, CancellationToken cancellationToken); /// /// Retrieve next list of hybrid runbook worker groups. (see diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupListParameters.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupListParameters.cs new file mode 100644 index 000000000000..4299e9e9bbf8 --- /dev/null +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupListParameters.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +using System; +using System.Linq; +using Microsoft.Azure.Management.Automation.Models; + +namespace Microsoft.Azure.Management.Automation.Models +{ + /// + /// The parameters supplied to the list hybrid runbook worker group items + /// operation. + /// + public partial class HybridRunbookWorkerGroupListParameters : ParametersWithSkipToken + { + private string _groupType; + + /// + /// Optional. The type of the hybrid runbook worker group. + /// + public string GroupType + { + get { return this._groupType; } + set { this._groupType = value; } + } + + /// + /// Initializes a new instance of the + /// HybridRunbookWorkerGroupListParameters class. + /// + public HybridRunbookWorkerGroupListParameters() + { + } + } +} diff --git a/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupType.cs b/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupType.cs new file mode 100644 index 000000000000..9c9196bed8b6 --- /dev/null +++ b/src/ResourceManagement/Automation/AutomationManagement/Generated/Models/HybridRunbookWorkerGroupType.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +using System; +using System.Linq; + +namespace Microsoft.Azure.Management.Automation.Models +{ + /// + /// The hybrid runbook worker group type. + /// + public static partial class HybridRunbookWorkerGroupType + { + public const string User = "User"; + + public const string System = "System"; + } +}