Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating sdk with latest hyak #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -800,23 +800,23 @@ public async Task<LongRunningOperationResultResponse> 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;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,17 @@ public async Task<HybridRunbookWorkerGroupGetResponse> GetAsync(string resourceG
/// <param name='automationAccount'>
/// Required. The automation account name.
/// </param>
/// <param name='parameters'>
/// Optional. The parameters supplied to the list job stream's stream
/// items operation.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The response model for the list hybrid runbook worker groups.
/// </returns>
public async Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resourceGroupName, string automationAccount, CancellationToken cancellationToken)
public async Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters, CancellationToken cancellationToken)
{
// Validate
if (resourceGroupName == null)
Expand All @@ -519,6 +523,7 @@ public async Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resour
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("automationAccount", automationAccount);
tracingParameters.Add("parameters", parameters);
TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters);
}

Expand All @@ -540,6 +545,15 @@ public async Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resour
url = url + Uri.EscapeDataString(automationAccount);
url = url + "/hybridRunbookWorkerGroups";
List<string> queryParameters = new List<string>();
List<string> odataFilter = new List<string>();
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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,18 @@ public static Task<HybridRunbookWorkerGroupGetResponse> GetAsync(this IHybridRun
/// <param name='automationAccount'>
/// Required. The automation account name.
/// </param>
/// <param name='parameters'>
/// Optional. The parameters supplied to the list job stream's stream
/// items operation.
/// </param>
/// <returns>
/// The response model for the list hybrid runbook worker groups.
/// </returns>
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();
}
Expand All @@ -189,12 +193,16 @@ public static HybridRunbookWorkerGroupsListResponse List(this IHybridRunbookWork
/// <param name='automationAccount'>
/// Required. The automation account name.
/// </param>
/// <param name='parameters'>
/// Optional. The parameters supplied to the list job stream's stream
/// items operation.
/// </param>
/// <returns>
/// The response model for the list hybrid runbook worker groups.
/// </returns>
public static Task<HybridRunbookWorkerGroupsListResponse> ListAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccount)
public static Task<HybridRunbookWorkerGroupsListResponse> 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);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ public partial interface IHybridRunbookWorkerGroupOperations
/// <param name='automationAccount'>
/// The automation account name.
/// </param>
/// <param name='parameters'>
/// The parameters supplied to the list job stream's stream items
/// operation.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The response model for the list hybrid runbook worker groups.
/// </returns>
Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resourceGroupName, string automationAccount, CancellationToken cancellationToken);
Task<HybridRunbookWorkerGroupsListResponse> ListAsync(string resourceGroupName, string automationAccount, HybridRunbookWorkerGroupListParameters parameters, CancellationToken cancellationToken);

/// <summary>
/// Retrieve next list of hybrid runbook worker groups. (see
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// The parameters supplied to the list hybrid runbook worker group items
/// operation.
/// </summary>
public partial class HybridRunbookWorkerGroupListParameters : ParametersWithSkipToken
{
private string _groupType;

/// <summary>
/// Optional. The type of the hybrid runbook worker group.
/// </summary>
public string GroupType
{
get { return this._groupType; }
set { this._groupType = value; }
}

/// <summary>
/// Initializes a new instance of the
/// HybridRunbookWorkerGroupListParameters class.
/// </summary>
public HybridRunbookWorkerGroupListParameters()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// The hybrid runbook worker group type.
/// </summary>
public static partial class HybridRunbookWorkerGroupType
{
public const string User = "User";

public const string System = "System";
}
}