/// <summary>
 /// Update the runbook definition identified by runbookVersionId.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the update runbook version's
 /// runbook definition operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse UpdateRunbookDefinition(this IRunbookVersionOperations operations, string automationAccount, RunbookVersionUpdateRunbookDefinitionParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookVersionOperations)s).UpdateRunbookDefinitionAsync(automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create a runbook version with runbookStream as its content.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookStream'>
 /// Required. The content of the runbook version.
 /// </param>
 /// <returns>
 /// The response model for the create runbook version operation.
 /// </returns>
 public static RunbookVersionCreateResponse Create(this IRunbookVersionOperations operations, string automationAccount, Stream runbookStream)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookVersionOperations)s).CreateAsync(automationAccount, runbookStream);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve a list of runbook versions filterd by parameters.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the list runbook version by
 /// runbook id and slot operation.
 /// </param>
 /// <returns>
 /// The response model for the list runbook version operation.
 /// </returns>
 public static RunbookVersionListResponse ListLatestByRunbookIdSlot(this IRunbookVersionOperations operations, string automationAccount, RunbookVersionListLatestByRunbookIdSlotParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IRunbookVersionOperations)s).ListLatestByRunbookIdSlotAsync(automationAccount, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the AutomationManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AutomationManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._cloudServices     = new CloudServiceOperations(this);
     this._jobs              = new JobOperations(this);
     this._jobStreams        = new JobStreamOperation(this);
     this._runbooks          = new RunbookOperations(this);
     this._runbookParameters = new RunbookParameterOperations(this);
     this._runbookVersions   = new RunbookVersionOperations(this);
     this._schedules         = new ScheduleOperations(this);
     this._apiVersion        = "2013-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Create a runbook version with runbookStream as its content.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookStream'>
 /// Required. The content of the runbook version.
 /// </param>
 /// <returns>
 /// The response model for the create runbook version operation.
 /// </returns>
 public static Task <RunbookVersionCreateResponse> CreateAsync(this IRunbookVersionOperations operations, string automationAccount, Stream runbookStream)
 {
     return(operations.CreateAsync(automationAccount, runbookStream, CancellationToken.None));
 }
 /// <summary>
 /// Update the runbook definition identified by runbookVersionId.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the update runbook version's
 /// runbook definition operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <OperationResponse> UpdateRunbookDefinitionAsync(this IRunbookVersionOperations operations, string automationAccount, RunbookVersionUpdateRunbookDefinitionParameters parameters)
 {
     return(operations.UpdateRunbookDefinitionAsync(automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve a list of runbook versions filterd by parameters.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters supplied to the list runbook version by
 /// runbook id and slot operation.
 /// </param>
 /// <returns>
 /// The response model for the list runbook version operation.
 /// </returns>
 public static Task <RunbookVersionListResponse> ListLatestByRunbookIdSlotAsync(this IRunbookVersionOperations operations, string automationAccount, RunbookVersionListLatestByRunbookIdSlotParameters parameters)
 {
     return(operations.ListLatestByRunbookIdSlotAsync(automationAccount, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve a list of runbook versions which are either the draft or
 /// the published runbook version of the runbook identified by
 /// runbookId.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookId'>
 /// Required. The runbook id.
 /// </param>
 /// <returns>
 /// The response model for the list runbook version operation.
 /// </returns>
 public static Task <RunbookVersionListResponse> ListLatestByRunbookIdAsync(this IRunbookVersionOperations operations, string automationAccount, string runbookId)
 {
     return(operations.ListLatestByRunbookIdAsync(automationAccount, runbookId, CancellationToken.None));
 }
 /// <summary>
 /// Retrieve the runbook definition identified by runbookVersionId.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Automation.IRunbookVersionOperations.
 /// </param>
 /// <param name='automationAccount'>
 /// Required. The automation account name.
 /// </param>
 /// <param name='runbookVersionId'>
 /// Required. The runbook version id.
 /// </param>
 /// <returns>
 /// The response model for the get runbook definition operation.
 /// </returns>
 public static Task <RunbookVersionGetRunbookDefinitionResponse> GetRunbookDefinitionAsync(this IRunbookVersionOperations operations, string automationAccount, string runbookVersionId)
 {
     return(operations.GetRunbookDefinitionAsync(automationAccount, runbookVersionId, CancellationToken.None));
 }