/// <summary> /// Creates a new switch. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='boardId'> /// The board identifier. /// </param> /// <param name='switchPostModel'> /// The switch model. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SwitchModel> CreateSwitchAsync(this ISoftheonSwitchboard operations, int boardId, SwitchPostModel switchPostModel = default(SwitchPostModel), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateSwitchWithHttpMessagesAsync(boardId, switchPostModel, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates a new switch. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='boardId'> /// The board identifier. /// </param> /// <param name='switchPostModel'> /// The switch model. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> public static HttpOperationResponse <SwitchModel> CreateSwitchWithHttpMessages(this ISoftheonSwitchboard operations, int boardId, SwitchPostModel switchPostModel = default(SwitchPostModel), Dictionary <string, List <string> > customHeaders = null) { return(operations.CreateSwitchWithHttpMessagesAsync(boardId, switchPostModel, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult()); }
/// <summary> /// Creates a new switch. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='boardId'> /// The board identifier. /// </param> /// <param name='switchPostModel'> /// The switch model. /// </param> public static SwitchModel CreateSwitch(this ISoftheonSwitchboard operations, int boardId, SwitchPostModel switchPostModel = default(SwitchPostModel)) { return(operations.CreateSwitchAsync(boardId, switchPostModel).GetAwaiter().GetResult()); }