diff --git a/src/SDKs/Automation/Automation.Tests/ScenarioTests/AutomationTests.cs b/src/SDKs/Automation/Automation.Tests/ScenarioTests/AutomationTests.cs index 22fd20a5ba88..2fcb6ba6b1c3 100644 --- a/src/SDKs/Automation/Automation.Tests/ScenarioTests/AutomationTests.cs +++ b/src/SDKs/Automation/Automation.Tests/ScenarioTests/AutomationTests.cs @@ -48,8 +48,7 @@ public void CanCreateUpdateDeleteRunbook() testFixture.UpdateRunbookContent(runbookName, runbookContentV2); var updatedContent = testFixture.GetRunbookContent(runbookName); - var reader = new StreamReader(updatedContent); - Assert.Equal(runbookContentV2, reader.ReadToEnd()); + Assert.Equal(runbookContentV2, updatedContent); testFixture.DeleteRunbook(runbookName); diff --git a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/BaseTest.cs b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/BaseTest.cs index 8040af6fc8bd..2f070a066b7c 100644 --- a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/BaseTest.cs +++ b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/BaseTest.cs @@ -22,8 +22,6 @@ protected void CreateAutomationClient(MockContext context) { var handler = new RecordedDelegatingHandler(); this.automationClient = context.GetServiceClient(false, handler); - this.automationClient.ResourceGroupName = ResourceGroupName; - this.automationClient.AutomationAccountName = AutomationAccountName; } } } diff --git a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationMachineRunTests.cs b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationMachineRunTests.cs index 5d31cf43d53b..ab25b3b89539 100644 --- a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationMachineRunTests.cs +++ b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationMachineRunTests.cs @@ -17,7 +17,7 @@ public void CanGetMachineRunById() { this.CreateAutomationClient(context); - var run = this.automationClient.SoftwareUpdateConfigurationMachineRuns.GetById(runId); + var run = this.automationClient.SoftwareUpdateConfigurationMachineRuns.GetById(ResourceGroupName, AutomationAccountName, runId); Assert.NotNull(run); Assert.Equal(runId.ToString(), run.Name); } @@ -30,7 +30,7 @@ public void CanGetAllMachineRuns() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.List(); + var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.List(ResourceGroupName, AutomationAccountName); Assert.NotNull(runs.Value); Assert.Equal(27, runs.Value.Count); } @@ -44,7 +44,7 @@ public void CanGetAllRunsByCorrelationId() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.ListByCorrelationId(correlationId); + var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.ListByCorrelationId(ResourceGroupName, AutomationAccountName, correlationId); Assert.NotNull(runs.Value); Assert.Equal(2, runs.Value.Count); } @@ -58,7 +58,7 @@ public void CanGetAllRunsByStatus() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.ListByStatus(status); + var runs = this.automationClient.SoftwareUpdateConfigurationMachineRuns.ListByStatus(ResourceGroupName, AutomationAccountName, status); Assert.NotNull(runs.Value); Assert.Equal(4, runs.Value.Count); } diff --git a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationRunTests.cs b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationRunTests.cs index 4520bf048760..9e220e269674 100644 --- a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationRunTests.cs +++ b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationRunTests.cs @@ -17,7 +17,7 @@ public void CanGetRunById() { this.CreateAutomationClient(context); - var run = this.automationClient.SoftwareUpdateConfigurationRuns.GetById(runId); + var run = this.automationClient.SoftwareUpdateConfigurationRuns.GetById(ResourceGroupName, AutomationAccountName, runId); Assert.NotNull(run); Assert.Equal(runId.ToString(), run.Name); } @@ -30,7 +30,7 @@ public void CanGetAllRuns() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationRuns.List(); + var runs = this.automationClient.SoftwareUpdateConfigurationRuns.List(ResourceGroupName, AutomationAccountName); Assert.NotNull(runs.Value); Assert.Equal(15, runs.Value.Count); } @@ -44,7 +44,7 @@ public void CanGetAllRunsByConfigurationName() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByConfigurationName(configName); + var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByConfigurationName(ResourceGroupName, AutomationAccountName, configName); Assert.NotNull(runs.Value); Assert.Equal(6, runs.Value.Count); } @@ -58,7 +58,7 @@ public void CanGetAllRunsByOs() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByOsType(os); + var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByOsType(ResourceGroupName, AutomationAccountName, os); Assert.NotNull(runs.Value); Assert.Equal(17, runs.Value.Count); } @@ -72,7 +72,7 @@ public void CanGetAllRunsByStatus() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByStatus(status); + var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByStatus(ResourceGroupName, AutomationAccountName, status); Assert.NotNull(runs.Value); Assert.Equal(2, runs.Value.Count); } @@ -86,7 +86,7 @@ public void CanGetAllRunsByStartTime() { this.CreateAutomationClient(context); - var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByStartTime(startTime); + var runs = this.automationClient.SoftwareUpdateConfigurationRuns.ListByStartTime(ResourceGroupName, AutomationAccountName, startTime); Assert.NotNull(runs.Value); Assert.Equal(3, runs.Value.Count); } diff --git a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationTests.cs b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationTests.cs index ec37e2c6b3e5..074eab637112 100644 --- a/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationTests.cs +++ b/src/SDKs/Automation/Automation.Tests/ScenarioTests/UpdateManagement/SoftwareUpdateConfigurationTests.cs @@ -20,28 +20,28 @@ public void CanCreateGetAndDelete() // Create and get the first SUC (targeting 1 VMs) var sucProperties = this.CreateSoftwareUpdateConfigurationModel(new[] { VM_01 }); - var createResult = this.automationClient.SoftwareUpdateConfigurations.Create(updateConfigurationName_01, sucProperties); + var createResult = this.automationClient.SoftwareUpdateConfigurations.Create(ResourceGroupName, AutomationAccountName, updateConfigurationName_01, sucProperties); Assert.NotNull(createResult); - var getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(updateConfigurationName_01); + var getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(ResourceGroupName, AutomationAccountName, updateConfigurationName_01); Assert.NotNull(getResult); // Create and get the second SUC (targeting 2 VMs) sucProperties = this.CreateSoftwareUpdateConfigurationModel(new[] { VM_01, VM_02}); - createResult = this.automationClient.SoftwareUpdateConfigurations.Create(updateConfigurationName_02, sucProperties); + createResult = this.automationClient.SoftwareUpdateConfigurations.Create(ResourceGroupName, AutomationAccountName, updateConfigurationName_02, sucProperties); Assert.NotNull(createResult); - getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(updateConfigurationName_02); + getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(ResourceGroupName, AutomationAccountName, updateConfigurationName_02); Assert.NotNull(getResult); // List all SUCs - var listResult = this.automationClient.SoftwareUpdateConfigurations.List(); + var listResult = this.automationClient.SoftwareUpdateConfigurations.List(ResourceGroupName, AutomationAccountName); Assert.NotNull(listResult); Assert.NotNull(listResult.Value); Assert.Equal(9, listResult.Value.Count); // List for specific VM - listResult = this.automationClient.SoftwareUpdateConfigurations.ListByAzureVirtualMachine(VM_01); + listResult = this.automationClient.SoftwareUpdateConfigurations.ListByAzureVirtualMachine(ResourceGroupName, AutomationAccountName, VM_01); Assert.NotNull(listResult); Assert.NotNull(listResult.Value); Assert.Equal(6, listResult.Value.Count); @@ -49,12 +49,12 @@ public void CanCreateGetAndDelete() Assert.Equal(updateConfigurationName_01, suc.Name); // Delete both - this.automationClient.SoftwareUpdateConfigurations.Delete(updateConfigurationName_01); - getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(updateConfigurationName_01); + this.automationClient.SoftwareUpdateConfigurations.Delete(ResourceGroupName, AutomationAccountName, updateConfigurationName_01); + getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(ResourceGroupName, AutomationAccountName, updateConfigurationName_01); Assert.Null(getResult); - this.automationClient.SoftwareUpdateConfigurations.Delete(updateConfigurationName_02); - getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(updateConfigurationName_02); + this.automationClient.SoftwareUpdateConfigurations.Delete(ResourceGroupName, AutomationAccountName, updateConfigurationName_02); + getResult = this.automationClient.SoftwareUpdateConfigurations.GetByName(ResourceGroupName, AutomationAccountName, updateConfigurationName_02); Assert.Null(getResult); } } diff --git a/src/SDKs/Automation/Automation.Tests/TestSupport/AutomationTestBase.cs b/src/SDKs/Automation/Automation.Tests/TestSupport/AutomationTestBase.cs index a58a8fd2aaae..627ed28b5c6e 100644 --- a/src/SDKs/Automation/Automation.Tests/TestSupport/AutomationTestBase.cs +++ b/src/SDKs/Automation/Automation.Tests/TestSupport/AutomationTestBase.cs @@ -44,8 +44,6 @@ public AutomationTestBase(MockContext context) Location = Location, Sku = new Sku {Name = "Free", Family = "Test", Capacity = 1} }); - - AutomationClient.ResourceGroupName = ResourceGroup; } catch (CloudException ex) { @@ -64,7 +62,7 @@ public AutomationTestBase(MockContext context) public void CleanUpRunbooks() { - var runbooks = AutomationClient.Runbook.ListByAutomationAccount(AutomationAccount); + var runbooks = AutomationClient.Runbook.ListByAutomationAccount(ResourceGroup, AutomationAccount); foreach (var rb in runbooks) { @@ -74,7 +72,7 @@ public void CleanUpRunbooks() public void CleanUpSchedules() { - var schedules = AutomationClient.Schedule.ListByAutomationAccount(AutomationAccount); + var schedules = AutomationClient.Schedule.ListByAutomationAccount(ResourceGroup, AutomationAccount); foreach (var schedule in schedules) { @@ -84,7 +82,7 @@ public void CleanUpSchedules() public void CleanUpVariables() { - var variables = AutomationClient.Variable.ListByAutomationAccount(AutomationAccount); + var variables = AutomationClient.Variable.ListByAutomationAccount(ResourceGroup, AutomationAccount); foreach (var variable in variables) { @@ -95,7 +93,7 @@ public void CleanUpVariables() public void CleanUpWebhooks() { var webhooks = - AutomationClient.Webhook.ListByAutomationAccount(AutomationAccount); + AutomationClient.Webhook.ListByAutomationAccount(ResourceGroup, AutomationAccount); foreach (var webhook in webhooks) { @@ -106,7 +104,7 @@ public void CleanUpWebhooks() public Credential CreateCredential(string credentialName, string userName, string password, string description = null) { - var credential = AutomationClient.Credential.CreateOrUpdate(AutomationAccount, + var credential = AutomationClient.Credential.CreateOrUpdate(ResourceGroup, AutomationAccount, credentialName, new CredentialCreateOrUpdateParameters(credentialName, userName, @@ -117,7 +115,7 @@ public Credential CreateCredential(string credentialName, string userName, strin public Webhook CreateWebhook(string webhookName, string runbookName, string uri, string description = null) { - var webhook = AutomationClient.Webhook.CreateOrUpdate(AutomationAccount, webhookName, + var webhook = AutomationClient.Webhook.CreateOrUpdate(ResourceGroup, AutomationAccount, webhookName, new WebhookCreateOrUpdateParameters { Name = webhookName, @@ -131,12 +129,12 @@ public Webhook CreateWebhook(string webhookName, string runbookName, string uri, public string GenerateUriForWebhook() { - return AutomationClient.Webhook.GenerateUri(AutomationAccount); + return AutomationClient.Webhook.GenerateUri(ResourceGroup, AutomationAccount); } public void CreateRunbook(string runbookName, string runbookContent, string description = null) { - AutomationClient.Runbook.CreateOrUpdate(AutomationAccount, runbookName, + AutomationClient.Runbook.CreateOrUpdate(ResourceGroup, AutomationAccount, runbookName, new RunbookCreateOrUpdateParameters { Name = runbookName, @@ -152,7 +150,7 @@ public void CreateRunbook(string runbookName, string runbookContent, string desc public Schedule CreateHourlySchedule(string scheduleName, DateTimeOffset startTime, DateTimeOffset expiryTime, string description = null, byte hourInterval = 1) { - var schedule = AutomationClient.Schedule.CreateOrUpdate(AutomationAccount, scheduleName, + var schedule = AutomationClient.Schedule.CreateOrUpdate(ResourceGroup, AutomationAccount, scheduleName, new ScheduleCreateOrUpdateParameters { Name = scheduleName, @@ -169,7 +167,7 @@ public Schedule CreateHourlySchedule(string scheduleName, DateTimeOffset startTi #region Module Methods public Module CreateAutomationModule(string moduleName, string contentLink) { - var module = AutomationClient.Module.CreateOrUpdate(AutomationAccount, moduleName, + var module = AutomationClient.Module.CreateOrUpdate(ResourceGroup, AutomationAccount, moduleName, new ModuleCreateOrUpdateParameters { Name = moduleName, @@ -182,7 +180,7 @@ public Module CreateAutomationModule(string moduleName, string contentLink) public Module GetAutomationModule(string moduleName) { - var module = AutomationClient.Module.Get(AutomationAccount, moduleName); + var module = AutomationClient.Module.Get(ResourceGroup, AutomationAccount, moduleName); return module; } @@ -190,7 +188,7 @@ public void DeleteModule(string moduleName, bool ignoreErrors = false) { try { - AutomationClient.Module.Delete(AutomationAccount, moduleName); + AutomationClient.Module.Delete(ResourceGroup, AutomationAccount, moduleName); } catch (ErrorResponseException) { @@ -208,13 +206,13 @@ public void DeleteModule(string moduleName, bool ignoreErrors = false) public Job WaitForJobCompletion(Guid jobId, string expectedState = "Completed", int numRetries = 50) { - var job = AutomationClient.Job.Get(AutomationAccount, jobId); + var job = AutomationClient.Job.Get(ResourceGroup, AutomationAccount, jobId.ToString()); var endStates = new[] {"Stopped", "Suspended", "Failed", "Completed"}; var retry = 0; while (job.Status != expectedState && retry < numRetries && !Array.Exists(endStates, s => s == job.Status)) { TestUtilities.Wait(6000); - job = AutomationClient.Job.Get(AutomationAccount, jobId); + job = AutomationClient.Job.Get(ResourceGroup, AutomationAccount, jobId.ToString()); retry++; } @@ -223,7 +221,7 @@ public Job WaitForJobCompletion(Guid jobId, string expectedState = "Completed", public void UpdateRunbook(Runbook runbook) { - AutomationClient.Runbook.Update(AutomationAccount, runbook.Name, new RunbookUpdateParameters + AutomationClient.Runbook.Update(ResourceGroup, AutomationAccount, runbook.Name, new RunbookUpdateParameters { Name = runbook.Name, Description = runbook.Description, @@ -235,24 +233,12 @@ public void UpdateRunbook(Runbook runbook) public void UpdateRunbookContent(string runbookName, string runbookContent) { var byteArray = Encoding.ASCII.GetBytes(runbookContent); - AutomationClient.RunbookDraft.BeginCreateOrUpdate(AutomationAccount, runbookName, - new MemoryStream(byteArray)); + AutomationClient.RunbookDraft.ReplaceContent(ResourceGroup, AutomationAccount, runbookName, byteArray.ToString()); } public void PublishRunbook(string runbookName) { - AutomationClient.RunbookDraft.BeginPublish(AutomationAccount, runbookName); - } - - public Job StartRunbook(string runbookName, IDictionary parameters = null) - { - var job = AutomationClient.Job.Create(AutomationAccount, Guid.NewGuid(), - new JobCreateParameters - { - Name = runbookName, - Parameters = parameters - }); - return job; + AutomationClient.RunbookDraft.BeginPublish(ResourceGroup, AutomationAccount, runbookName); } public IPage GetJobStreams(Guid jobId, string streamType, DateTime startTime) @@ -263,20 +249,20 @@ public IPage GetJobStreams(Guid jobId, string streamType, DateTime st public Runbook GetRunbook(string runbookName) { - var runbook = AutomationClient.Runbook.Get(AutomationAccount, runbookName); + var runbook = AutomationClient.Runbook.Get(ResourceGroup, AutomationAccount, runbookName); return runbook; } - public Stream GetRunbookContent(string runbookName) + public string GetRunbookContent(string runbookName) { var runbookContentStream = - AutomationClient.RunbookDraft.GetContent(AutomationAccount, runbookName); + AutomationClient.RunbookDraft.GetContent(ResourceGroup, AutomationAccount, runbookName); return runbookContentStream; } public void DeleteRunbook(string runbookName) { - AutomationClient.Runbook.Delete(AutomationAccount, runbookName); + AutomationClient.Runbook.Delete(ResourceGroup, AutomationAccount, runbookName); } #endregion @@ -285,7 +271,7 @@ public void DeleteRunbook(string runbookName) public void UpdateVariable(Variable variable) { - AutomationClient.Variable.Update(AutomationAccount, + AutomationClient.Variable.Update(ResourceGroup, AutomationAccount, variable.Name, new VariableUpdateParameters { Value = variable.Value, @@ -296,7 +282,7 @@ public void UpdateVariable(Variable variable) public void DeleteVariable(string variableName) { - AutomationClient.Variable.Delete(AutomationAccount, variableName); + AutomationClient.Variable.Delete(ResourceGroup, AutomationAccount, variableName); } #endregion @@ -305,7 +291,7 @@ public void DeleteVariable(string variableName) public void UpdateSchedule(Schedule schedule) { - AutomationClient.Schedule.Update(AutomationAccount, schedule.Name, + AutomationClient.Schedule.Update(ResourceGroup, AutomationAccount, schedule.Name, new ScheduleUpdateParameters { Name = schedule.Name, @@ -316,13 +302,13 @@ public void UpdateSchedule(Schedule schedule) public Schedule GetSchedule(string scheduleName) { - var schedule = AutomationClient.Schedule.Get(AutomationAccount, scheduleName); + var schedule = AutomationClient.Schedule.Get(ResourceGroup, AutomationAccount, scheduleName); return schedule; } public void DeleteSchedule(string scheduleName) { - AutomationClient.Schedule.Delete(AutomationAccount, scheduleName); + AutomationClient.Schedule.Delete(ResourceGroup, AutomationAccount, scheduleName); } #endregion @@ -331,19 +317,19 @@ public void DeleteSchedule(string scheduleName) public Credential GetCredential(string credentialName) { - return AutomationClient.Credential.Get(AutomationAccount, credentialName); + return AutomationClient.Credential.Get(ResourceGroup, AutomationAccount, credentialName); } public IPage GetCredentials() { IPage credentials = - AutomationClient.Credential.ListByAutomationAccount(AutomationAccount); + AutomationClient.Credential.ListByAutomationAccount(ResourceGroup, AutomationAccount); return credentials; } public void UpdateCredential(Credential credential, string password = null, string userName = null) { - AutomationClient.Credential.Update(AutomationAccount, credential.Name, + AutomationClient.Credential.Update(ResourceGroup, AutomationAccount, credential.Name, new CredentialUpdateParameters { Name = userName, @@ -355,7 +341,7 @@ public void UpdateCredential(Credential credential, string password = null, stri public void CleanUpCredentials() { - var credentials = AutomationClient.Credential.ListByAutomationAccount(AutomationAccount); + var credentials = AutomationClient.Credential.ListByAutomationAccount(ResourceGroup, AutomationAccount); foreach (var cr in credentials) { @@ -365,7 +351,7 @@ public void CleanUpCredentials() public Variable CreateVariable(string variableName, object value, string description = null) { - var variable = AutomationClient.Variable.CreateOrUpdate(AutomationAccount, variableName, + var variable = AutomationClient.Variable.CreateOrUpdate(ResourceGroup, AutomationAccount, variableName, new VariableCreateOrUpdateParameters { Name = variableName, @@ -378,7 +364,7 @@ public Variable CreateVariable(string variableName, object value, string descrip public void DeleteCredential(string credentialName) { - AutomationClient.Credential.Delete(AutomationAccount, credentialName); + AutomationClient.Credential.Delete(ResourceGroup, AutomationAccount, credentialName); } #endregion @@ -387,24 +373,24 @@ public void DeleteCredential(string credentialName) public Variable GetVariable(string variableName) { - var variable = AutomationClient.Variable.Get(AutomationAccount, variableName); + var variable = AutomationClient.Variable.Get(ResourceGroup, AutomationAccount, variableName); return variable; } public IPage GetVariables() { - var variables = AutomationClient.Variable.ListByAutomationAccount(AutomationAccount); + var variables = AutomationClient.Variable.ListByAutomationAccount(ResourceGroup, AutomationAccount); return variables; } public void DeleteWebhook(string webhookName) { - AutomationClient.Webhook.Delete(AutomationAccount, webhookName); + AutomationClient.Webhook.Delete(ResourceGroup, AutomationAccount, webhookName); } public void UpdateWebhook(Webhook webhook) { - AutomationClient.Webhook.Update(AutomationAccount, webhook.Name, new WebhookUpdateParameters + AutomationClient.Webhook.Update(ResourceGroup, AutomationAccount, webhook.Name, new WebhookUpdateParameters { Name = webhook.Name, IsEnabled = webhook.IsEnabled @@ -423,13 +409,13 @@ public IPage GetWebhooks(string runbookName = null) { filter = string.Join(null, odataFilter); } - var webhooks = AutomationClient.Webhook.ListByAutomationAccount(AutomationAccount, filter); + var webhooks = AutomationClient.Webhook.ListByAutomationAccount(ResourceGroup, AutomationAccount, filter); return webhooks; } public Webhook GetWebhook(string webhookName) { - var webhook = AutomationClient.Webhook.Get(AutomationAccount, webhookName); + var webhook = AutomationClient.Webhook.Get(ResourceGroup, AutomationAccount, webhookName); return webhook; } @@ -441,7 +427,7 @@ public DscConfiguration CreateDscConfiguration(string configName, string configC string description = null, string contentHashValue = null, string contentHashAlgorithm = "sha256", string contentType = null) { - return AutomationClient.DscConfiguration.CreateOrUpdate(AutomationAccount, configName, + return AutomationClient.DscConfiguration.CreateOrUpdate(ResourceGroup, AutomationAccount, configName, new DscConfigurationCreateOrUpdateParameters { Location = Location, @@ -462,26 +448,26 @@ public DscConfiguration CreateDscConfiguration(string configName, string configC public DscConfiguration GetDscConfiguration(string configName) { - return AutomationClient.DscConfiguration.Get(AutomationAccount, configName); + return AutomationClient.DscConfiguration.Get(ResourceGroup, AutomationAccount, configName); } public IPage GetDscConfigurations() { var dscConfigurations = - AutomationClient.DscConfiguration.ListByAutomationAccount(AutomationAccount); + AutomationClient.DscConfiguration.ListByAutomationAccount(ResourceGroup, AutomationAccount); return dscConfigurations; } public void DeleteDscConfiguration(string configName) { - AutomationClient.DscConfiguration.Delete(AutomationAccount, configName); + AutomationClient.DscConfiguration.Delete(ResourceGroup, AutomationAccount, configName); } public void UpdateDscConfiguration(DscConfiguration configuration, string configContent, string description = null, string contentHashValue = null, string contentHashAlgorithm = "sha256", string contentType = null) { - AutomationClient.DscConfiguration.CreateOrUpdate(AutomationAccount, configuration.Name, + AutomationClient.DscConfiguration.CreateOrUpdate(ResourceGroup, AutomationAccount, configuration.Name, new DscConfigurationCreateOrUpdateParameters { Description = configuration.Description, @@ -508,8 +494,8 @@ public DscNodeConfiguration CreateDscNodeConfiguration(string nodeConfigurationN string nodeConfigurationContent, string contentHashValue, string contentHashAlgorithm, string contentType, string contentVersion) { - return AutomationClient.DscNodeConfiguration.CreateOrUpdate(AutomationAccount, - nodeConfigurationName, new DscNodeConfigurationCreateOrUpdateParameters + return AutomationClient.DscNodeConfiguration.CreateOrUpdate(ResourceGroup, AutomationAccount, + nodeConfigurationName, new DscNodeConfigurationCreateOrUpdateParametersProperties { Name = nodeConfigurationName, Configuration = new DscConfigurationAssociationProperty(configurationName), @@ -529,14 +515,14 @@ public DscNodeConfiguration CreateDscNodeConfiguration(string nodeConfigurationN public DscNodeConfiguration GetDscNodeConfiguration(string nodeConfigName) { - return AutomationClient.DscNodeConfiguration.Get(AutomationAccount, nodeConfigName); + return AutomationClient.DscNodeConfiguration.Get(ResourceGroup, AutomationAccount, nodeConfigName); } public void UpdateDscNodeConfiguration(DscNodeConfiguration nodeConfig, string configContent, string contentHashValue, string contentHashAlgorithm, string contentType, string contentVersion) { - AutomationClient.DscNodeConfiguration.CreateOrUpdate(AutomationAccount, - nodeConfig.Name, new DscNodeConfigurationCreateOrUpdateParameters + AutomationClient.DscNodeConfiguration.CreateOrUpdate(ResourceGroup, AutomationAccount, + nodeConfig.Name, new DscNodeConfigurationCreateOrUpdateParametersProperties { Name = nodeConfig.Name, Configuration = new DscConfigurationAssociationProperty(nodeConfig.Configuration.Name), @@ -556,12 +542,12 @@ public void UpdateDscNodeConfiguration(DscNodeConfiguration nodeConfig, string c public void DeleteDscNodeConfiguration(string configName) { - AutomationClient.DscNodeConfiguration.Delete(AutomationAccount, configName); + AutomationClient.DscNodeConfiguration.Delete(ResourceGroup, AutomationAccount, configName); } public IPage GetDscNodeConfigurations() { - return AutomationClient.DscNodeConfiguration.ListByAutomationAccount(AutomationAccount); + return AutomationClient.DscNodeConfiguration.ListByAutomationAccount(ResourceGroup, AutomationAccount); } #endregion diff --git a/src/SDKs/Automation/AzSdk.RP.props b/src/SDKs/Automation/AzSdk.RP.props index 64fb487883be..cf0b5414daa6 100644 --- a/src/SDKs/Automation/AzSdk.RP.props +++ b/src/SDKs/Automation/AzSdk.RP.props @@ -1,7 +1,7 @@  - Automation_2015-10-31;Automation_2017-05-15-preview; + Automation_2015-10-31;Automation_2018-01-15;Automation_2017-05-15-preview; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs index d9e4b767d781..e25939b98f5d 100644 --- a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationMachineRunListResult ListByStatus(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string status, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationMachineRunListResult ListByStatus(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string status, string skip = default(string), string top = default(string)) { return operations.ListByStatusAsync(status, skip, top).GetAwaiter().GetResult(); } @@ -58,10 +58,10 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// The cancellation token. /// - public static async Task ListByStatusAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string status, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByStatusAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string status, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatStringEqual, StatusProperty, status); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -85,9 +85,9 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationMachineRunListResult ListByCorrelationId(this ISoftwareUpdateConfigurationMachineRunsOperations operations, Guid correlationId, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationMachineRunListResult ListByCorrelationId(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, Guid correlationId, string skip = default(string), string top = default(string)) { - return operations.ListByCorrelationIdAsync(correlationId, skip, top).GetAwaiter().GetResult(); + return operations.ListByCorrelationIdAsync(resourceGroupName, automationAccountName, correlationId, skip, top).GetAwaiter().GetResult(); } /// @@ -109,10 +109,10 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// The cancellation token. /// - public static async Task ListByCorrelationIdAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, Guid correlationId, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByCorrelationIdAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, Guid correlationId, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatEqual, CorrelationIdProperty, correlationId); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -136,9 +136,9 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationMachineRunListResult ListByTargetComputer(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string osType, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationMachineRunListResult ListByTargetComputer(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string osType, string skip = default(string), string top = default(string)) { - return operations.ListByTargetComputerAsync(osType, skip, top).GetAwaiter().GetResult(); + return operations.ListByTargetComputerAsync(resourceGroupName, automationAccountName, osType, skip, top).GetAwaiter().GetResult(); } /// @@ -160,10 +160,10 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// The cancellation token. /// - public static async Task ListByTargetComputerAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string targetComputer, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByTargetComputerAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string targetComputer, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatStringEqual, TargetComputerProperty, targetComputer); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationRunsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationRunsOperationsExtensions.cs index b05f7f953d84..2a344cb6a1c1 100644 --- a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationRunsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationRunsOperationsExtensions.cs @@ -35,7 +35,7 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationRunListResult ListByConfigurationName(this ISoftwareUpdateConfigurationRunsOperations operations, string configurationName, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationRunListResult ListByConfigurationName(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string configurationName, string skip = default(string), string top = default(string)) { return operations.ListByConfigurationNameAsync(configurationName, skip, top).GetAwaiter().GetResult(); } @@ -59,10 +59,10 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByConfigurationNameAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string configurationName, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByConfigurationNameAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string configurationName, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatStringEqual, ConfigurationNameProperty, configurationName); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync("", "", null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -86,7 +86,7 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationRunListResult ListByOsType(this ISoftwareUpdateConfigurationRunsOperations operations, string osType, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationRunListResult ListByOsType(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string osType, string skip = default(string), string top = default(string)) { return operations.ListByOsTypeAsync(osType, skip, top).GetAwaiter().GetResult(); } @@ -110,10 +110,10 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByOsTypeAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string osType, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByOsTypeAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string osType, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatStringEqual, OsTypeProperty, osType); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -137,9 +137,9 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationRunListResult ListByStatus(this ISoftwareUpdateConfigurationRunsOperations operations, string status, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationRunListResult ListByStatus(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string status, string skip = default(string), string top = default(string)) { - return operations.ListByStatusAsync(status, skip, top).GetAwaiter().GetResult(); + return operations.ListByStatusAsync(resourceGroupName, automationAccountName, status, skip, top).GetAwaiter().GetResult(); } /// @@ -161,10 +161,10 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByStatusAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string status, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByStatusAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string status, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatStringEqual, StatusProperty, status); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -188,9 +188,9 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationRunListResult ListByStartTime(this ISoftwareUpdateConfigurationRunsOperations operations, DateTime startTime, string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationRunListResult ListByStartTime(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, DateTime startTime, string skip = default(string), string top = default(string)) { - return operations.ListByStartTimeAsync(startTime, skip, top).GetAwaiter().GetResult(); + return operations.ListByStartTimeAsync(resourceGroupName, automationAccountName, startTime, skip, top).GetAwaiter().GetResult(); } /// @@ -212,10 +212,10 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByStartTimeAsync(this ISoftwareUpdateConfigurationRunsOperations operations, DateTime startTime, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByStartTimeAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, DateTime startTime, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(FilterFormatGreaterEqual, StartTimeProperty, startTime.ToString("o")); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationsOperationsExtensions.cs index fe4fe1b9a018..76033f6ce0bb 100644 --- a/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Customization/SoftwareUpdateConfigurationsOperationsExtensions.cs @@ -24,9 +24,9 @@ public static partial class SoftwareUpdateConfigurationsOperationsExtensions /// /// Azure resource manager Id of the virtual machine /// - public static SoftwareUpdateConfigurationListResult ListByAzureVirtualMachine(this ISoftwareUpdateConfigurationsOperations operations, string virtualMachineId) + public static SoftwareUpdateConfigurationListResult ListByAzureVirtualMachine(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string virtualMachineId) { - return operations.ListByAzureVirtualMachineAsync(virtualMachineId).GetAwaiter().GetResult(); + return operations.ListByAzureVirtualMachineAsync(resourceGroupName, automationAccountName, virtualMachineId).GetAwaiter().GetResult(); } /// @@ -48,10 +48,10 @@ public static SoftwareUpdateConfigurationListResult ListByAzureVirtualMachine(th /// /// The cancellation token. /// - public static async Task ListByAzureVirtualMachineAsync(this ISoftwareUpdateConfigurationsOperations operations, string virtualMachineId, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByAzureVirtualMachineAsync(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string virtualMachineId, string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { var filter = string.Format(LambdaFilterFormat, AzureVirtualMachinesProperty, virtualMachineId); - using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ActivityOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ActivityOperations.cs index 24dd0e968dc9..1d72bdba4a6f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ActivityOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ActivityOperations.cs @@ -55,6 +55,9 @@ internal ActivityOperations(AutomationClient client) /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -85,17 +88,25 @@ internal ActivityOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string moduleName, string activityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string activityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -122,6 +133,7 @@ internal ActivityOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("activityName", activityName); @@ -132,7 +144,7 @@ internal ActivityOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{activityName}", System.Uri.EscapeDataString(activityName)); @@ -266,6 +278,9 @@ internal ActivityOperations(AutomationClient client) /// Retrieve a list of activities in the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -293,17 +308,25 @@ internal ActivityOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByModuleWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByModuleWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -326,6 +349,7 @@ internal ActivityOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("apiVersion", apiVersion); @@ -335,7 +359,7 @@ internal ActivityOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ActivityOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ActivityOperationsExtensions.cs index f05b9d82236f..c787116f948e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ActivityOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ActivityOperationsExtensions.cs @@ -29,6 +29,9 @@ public static partial class ActivityOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -38,9 +41,9 @@ public static partial class ActivityOperationsExtensions /// /// The name of activity. /// - public static Activity Get(this IActivityOperations operations, string automationAccountName, string moduleName, string activityName) + public static Activity Get(this IActivityOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string activityName) { - return operations.GetAsync(automationAccountName, moduleName, activityName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, moduleName, activityName).GetAwaiter().GetResult(); } /// @@ -51,6 +54,9 @@ public static Activity Get(this IActivityOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -63,9 +69,9 @@ public static Activity Get(this IActivityOperations operations, string automatio /// /// The cancellation token. /// - public static async Task GetAsync(this IActivityOperations operations, string automationAccountName, string moduleName, string activityName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IActivityOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string activityName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, moduleName, activityName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, activityName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -78,15 +84,18 @@ public static Activity Get(this IActivityOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of module. /// - public static IPage ListByModule(this IActivityOperations operations, string automationAccountName, string moduleName) + public static IPage ListByModule(this IActivityOperations operations, string resourceGroupName, string automationAccountName, string moduleName) { - return operations.ListByModuleAsync(automationAccountName, moduleName).GetAwaiter().GetResult(); + return operations.ListByModuleAsync(resourceGroupName, automationAccountName, moduleName).GetAwaiter().GetResult(); } /// @@ -96,6 +105,9 @@ public static IPage ListByModule(this IActivityOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -105,9 +117,9 @@ public static IPage ListByModule(this IActivityOperations operations, /// /// The cancellation token. /// - public static async Task> ListByModuleAsync(this IActivityOperations operations, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByModuleAsync(this IActivityOperations operations, string resourceGroupName, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByModuleWithHttpMessagesAsync(automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByModuleWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperations.cs index 5689dc51325e..861a377a5bc5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperations.cs @@ -54,8 +54,11 @@ internal AgentRegistrationInformationOperations(AutomationClient client) /// Retrieve the automation agent registration information. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// Headers that will be added to request. @@ -78,28 +81,36 @@ internal AgentRegistrationInformationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,6 +118,7 @@ internal AgentRegistrationInformationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -115,9 +127,9 @@ internal AgentRegistrationInformationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -247,8 +259,11 @@ internal AgentRegistrationInformationOperations(AutomationClient client) /// Regenerate a primary or secondary agent registration key /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The name of the agent registration key to be regenerated @@ -274,17 +289,29 @@ internal AgentRegistrationInformationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeyWithHttpMessagesAsync(string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -299,11 +326,7 @@ internal AgentRegistrationInformationOperations(AutomationClient client) { parameters.Validate(); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -311,6 +334,7 @@ internal AgentRegistrationInformationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); @@ -320,9 +344,9 @@ internal AgentRegistrationInformationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperationsExtensions.cs index 7ab995debfca..d68e3504226f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/AgentRegistrationInformationOperationsExtensions.cs @@ -28,12 +28,15 @@ public static partial class AgentRegistrationInformationOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - public static AgentRegistration Get(this IAgentRegistrationInformationOperations operations, string automationAccountName) + public static AgentRegistration Get(this IAgentRegistrationInformationOperations operations, string resourceGroupName, string automationAccountName) { - return operations.GetAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -43,15 +46,18 @@ public static AgentRegistration Get(this IAgentRegistrationInformationOperations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IAgentRegistrationInformationOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IAgentRegistrationInformationOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -64,15 +70,18 @@ public static AgentRegistration Get(this IAgentRegistrationInformationOperations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The name of the agent registration key to be regenerated /// - public static AgentRegistration RegenerateKey(this IAgentRegistrationInformationOperations operations, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) + public static AgentRegistration RegenerateKey(this IAgentRegistrationInformationOperations operations, string resourceGroupName, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) { - return operations.RegenerateKeyAsync(automationAccountName, parameters).GetAwaiter().GetResult(); + return operations.RegenerateKeyAsync(resourceGroupName, automationAccountName, parameters).GetAwaiter().GetResult(); } /// @@ -82,8 +91,11 @@ public static AgentRegistration RegenerateKey(this IAgentRegistrationInformation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The name of the agent registration key to be regenerated @@ -91,9 +103,9 @@ public static AgentRegistration RegenerateKey(this IAgentRegistrationInformation /// /// The cancellation token. /// - public static async Task RegenerateKeyAsync(this IAgentRegistrationInformationOperations operations, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeyAsync(this IAgentRegistrationInformationOperations operations, string resourceGroupName, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(automationAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, automationAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/AutomationClient.cs b/src/SDKs/Automation/Management.Automation/Generated/AutomationClient.cs index 067845330cbb..d36c487274ef 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/AutomationClient.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/AutomationClient.cs @@ -53,21 +53,6 @@ public partial class AutomationClient : ServiceClient, IAutoma /// public string SubscriptionId { get; set; } - /// - /// The resource group name. - /// - public string ResourceGroupName { get; set; } - - /// - /// Identifies this specific client request. - /// - public string ClientRequestId { get; set; } - - /// - /// The name of the automation account. - /// - public string AutomationAccountName { get; set; } - /// /// Gets or sets the preferred language for the response. /// @@ -105,6 +90,11 @@ public partial class AutomationClient : ServiceClient, IAutoma /// public virtual IUsagesOperations Usages { get; private set; } + /// + /// Gets the IKeysOperations. + /// + public virtual IKeysOperations Keys { get; private set; } + /// /// Gets the ICertificateOperations. /// @@ -125,55 +115,25 @@ public partial class AutomationClient : ServiceClient, IAutoma /// public virtual ICredentialOperations Credential { get; private set; } - /// - /// Gets the IDscCompilationJobOperations. - /// - public virtual IDscCompilationJobOperations DscCompilationJob { get; private set; } - /// /// Gets the IDscConfigurationOperations. /// public virtual IDscConfigurationOperations DscConfiguration { get; private set; } - /// - /// Gets the IAgentRegistrationInformationOperations. - /// - public virtual IAgentRegistrationInformationOperations AgentRegistrationInformation { get; private set; } - - /// - /// Gets the IDscNodeOperations. - /// - public virtual IDscNodeOperations DscNode { get; private set; } - - /// - /// Gets the INodeReportsOperations. - /// - public virtual INodeReportsOperations NodeReports { get; private set; } - - /// - /// Gets the IDscNodeConfigurationOperations. - /// - public virtual IDscNodeConfigurationOperations DscNodeConfiguration { get; private set; } - /// /// Gets the IHybridRunbookWorkerGroupOperations. /// public virtual IHybridRunbookWorkerGroupOperations HybridRunbookWorkerGroup { get; private set; } /// - /// Gets the IJobOperations. - /// - public virtual IJobOperations Job { get; private set; } - - /// - /// Gets the IJobStreamOperations. + /// Gets the IJobScheduleOperations. /// - public virtual IJobStreamOperations JobStream { get; private set; } + public virtual IJobScheduleOperations JobSchedule { get; private set; } /// - /// Gets the IJobScheduleOperations. + /// Gets the ILinkedWorkspaceOperations. /// - public virtual IJobScheduleOperations JobSchedule { get; private set; } + public virtual ILinkedWorkspaceOperations LinkedWorkspace { get; private set; } /// /// Gets the IActivityOperations. @@ -211,9 +171,9 @@ public partial class AutomationClient : ServiceClient, IAutoma public virtual ITestJobStreamsOperations TestJobStreams { get; private set; } /// - /// Gets the ITestJobsOperations. + /// Gets the ITestJobOperations. /// - public virtual ITestJobsOperations TestJobs { get; private set; } + public virtual ITestJobOperations TestJob { get; private set; } /// /// Gets the IScheduleOperations. @@ -245,6 +205,56 @@ public partial class AutomationClient : ServiceClient, IAutoma /// public virtual ISoftwareUpdateConfigurationMachineRunsOperations SoftwareUpdateConfigurationMachineRuns { get; private set; } + /// + /// Gets the ISourceControlOperations. + /// + public virtual ISourceControlOperations SourceControl { get; private set; } + + /// + /// Gets the ISourceControlSyncJobOperations. + /// + public virtual ISourceControlSyncJobOperations SourceControlSyncJob { get; private set; } + + /// + /// Gets the IJobOperations. + /// + public virtual IJobOperations Job { get; private set; } + + /// + /// Gets the IJobStreamOperations. + /// + public virtual IJobStreamOperations JobStream { get; private set; } + + /// + /// Gets the IAgentRegistrationInformationOperations. + /// + public virtual IAgentRegistrationInformationOperations AgentRegistrationInformation { get; private set; } + + /// + /// Gets the IDscNodeOperations. + /// + public virtual IDscNodeOperations DscNode { get; private set; } + + /// + /// Gets the INodeReportsOperations. + /// + public virtual INodeReportsOperations NodeReports { get; private set; } + + /// + /// Gets the IDscCompilationJobOperations. + /// + public virtual IDscCompilationJobOperations DscCompilationJob { get; private set; } + + /// + /// Gets the IDscCompilationJobStreamOperations. + /// + public virtual IDscCompilationJobStreamOperations DscCompilationJobStream { get; private set; } + + /// + /// Gets the IDscNodeConfigurationOperations. + /// + public virtual IDscNodeConfigurationOperations DscNodeConfiguration { get; private set; } + /// /// Initializes a new instance of the AutomationClient class. /// @@ -450,20 +460,15 @@ private void Initialize() Operations = new Operations(this); Statistics = new StatisticsOperations(this); Usages = new UsagesOperations(this); + Keys = new KeysOperations(this); Certificate = new CertificateOperations(this); Connection = new ConnectionOperations(this); ConnectionType = new ConnectionTypeOperations(this); Credential = new CredentialOperations(this); - DscCompilationJob = new DscCompilationJobOperations(this); DscConfiguration = new DscConfigurationOperations(this); - AgentRegistrationInformation = new AgentRegistrationInformationOperations(this); - DscNode = new DscNodeOperations(this); - NodeReports = new NodeReportsOperations(this); - DscNodeConfiguration = new DscNodeConfigurationOperations(this); HybridRunbookWorkerGroup = new HybridRunbookWorkerGroupOperations(this); - Job = new JobOperations(this); - JobStream = new JobStreamOperations(this); JobSchedule = new JobScheduleOperations(this); + LinkedWorkspace = new LinkedWorkspaceOperations(this); Activity = new ActivityOperations(this); Module = new ModuleOperations(this); ObjectDataTypes = new ObjectDataTypesOperations(this); @@ -471,13 +476,23 @@ private void Initialize() RunbookDraft = new RunbookDraftOperations(this); Runbook = new RunbookOperations(this); TestJobStreams = new TestJobStreamsOperations(this); - TestJobs = new TestJobsOperations(this); + TestJob = new TestJobOperations(this); Schedule = new ScheduleOperations(this); Variable = new VariableOperations(this); Webhook = new WebhookOperations(this); SoftwareUpdateConfigurations = new SoftwareUpdateConfigurationsOperations(this); SoftwareUpdateConfigurationRuns = new SoftwareUpdateConfigurationRunsOperations(this); SoftwareUpdateConfigurationMachineRuns = new SoftwareUpdateConfigurationMachineRunsOperations(this); + SourceControl = new SourceControlOperations(this); + SourceControlSyncJob = new SourceControlSyncJobOperations(this); + Job = new JobOperations(this); + JobStream = new JobStreamOperations(this); + AgentRegistrationInformation = new AgentRegistrationInformationOperations(this); + DscNode = new DscNodeOperations(this); + NodeReports = new NodeReportsOperations(this); + DscCompilationJob = new DscCompilationJobOperations(this); + DscCompilationJobStream = new DscCompilationJobStreamOperations(this); + DscNodeConfiguration = new DscNodeConfigurationOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/src/SDKs/Automation/Management.Automation/Generated/CertificateOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/CertificateOperations.cs index 0fbfc1f1fd33..880bd306bead 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/CertificateOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/CertificateOperations.cs @@ -54,6 +54,9 @@ internal CertificateOperations(AutomationClient client) /// Delete the certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal CertificateOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -111,6 +122,7 @@ internal CertificateOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,7 +132,7 @@ internal CertificateOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -235,6 +247,9 @@ internal CertificateOperations(AutomationClient client) /// Retrieve the certificate identified by certificate name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -262,17 +277,25 @@ internal CertificateOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -295,6 +318,7 @@ internal CertificateOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,7 +328,7 @@ internal CertificateOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -437,6 +461,9 @@ internal CertificateOperations(AutomationClient client) /// Create a certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -467,17 +494,25 @@ internal CertificateOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -508,6 +543,7 @@ internal CertificateOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("parameters", parameters); @@ -518,7 +554,7 @@ internal CertificateOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -675,6 +711,9 @@ internal CertificateOperations(AutomationClient client) /// Update a certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -705,17 +744,25 @@ internal CertificateOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string certificateName, CertificateUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, CertificateUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -742,6 +789,7 @@ internal CertificateOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("certificateName", certificateName); tracingParameters.Add("parameters", parameters); @@ -752,7 +800,7 @@ internal CertificateOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -891,6 +939,9 @@ internal CertificateOperations(AutomationClient client) /// Retrieve a list of certificates. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -915,17 +966,25 @@ internal CertificateOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -944,6 +1003,7 @@ internal CertificateOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -952,7 +1012,7 @@ internal CertificateOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/CertificateOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/CertificateOperationsExtensions.cs index 3f4fda2b7c75..8cd9ec0a3e2c 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/CertificateOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/CertificateOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class CertificateOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of certificate. /// - public static void Delete(this ICertificateOperations operations, string automationAccountName, string certificateName) + public static void Delete(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName) { - operations.DeleteAsync(automationAccountName, certificateName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, certificateName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this ICertificateOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this ICertificateOperations operations, string automat /// /// The cancellation token. /// - public static async Task DeleteAsync(this ICertificateOperations operations, string automationAccountName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, certificateName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, certificateName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this ICertificateOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of certificate. /// - public static Certificate Get(this ICertificateOperations operations, string automationAccountName, string certificateName) + public static Certificate Get(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName) { - return operations.GetAsync(automationAccountName, certificateName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, certificateName).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static Certificate Get(this ICertificateOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static Certificate Get(this ICertificateOperations operations, string aut /// /// The cancellation token. /// - public static async Task GetAsync(this ICertificateOperations operations, string automationAccountName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, certificateName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, certificateName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static Certificate Get(this ICertificateOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static Certificate Get(this ICertificateOperations operations, string aut /// /// The parameters supplied to the create or update certificate operation. /// - public static Certificate CreateOrUpdate(this ICertificateOperations operations, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters) + public static Certificate CreateOrUpdate(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, certificateName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, certificateName, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static Certificate CreateOrUpdate(this ICertificateOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static Certificate CreateOrUpdate(this ICertificateOperations operations, /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ICertificateOperations operations, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, certificateName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, certificateName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,6 +175,9 @@ public static Certificate CreateOrUpdate(this ICertificateOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -166,9 +187,9 @@ public static Certificate CreateOrUpdate(this ICertificateOperations operations, /// /// The parameters supplied to the update certificate operation. /// - public static Certificate Update(this ICertificateOperations operations, string automationAccountName, string certificateName, CertificateUpdateParameters parameters) + public static Certificate Update(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CertificateUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, certificateName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, certificateName, parameters).GetAwaiter().GetResult(); } /// @@ -178,6 +199,9 @@ public static Certificate Update(this ICertificateOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -190,9 +214,9 @@ public static Certificate Update(this ICertificateOperations operations, string /// /// The cancellation token. /// - public static async Task UpdateAsync(this ICertificateOperations operations, string automationAccountName, string certificateName, CertificateUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, string certificateName, CertificateUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, certificateName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, certificateName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -205,12 +229,15 @@ public static Certificate Update(this ICertificateOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this ICertificateOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this ICertificateOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -220,15 +247,18 @@ public static IPage ListByAutomationAccount(this ICertificateOperat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this ICertificateOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this ICertificateOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperations.cs index f5d126a04eec..2cee9c1c366a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperations.cs @@ -54,6 +54,9 @@ internal ConnectionOperations(AutomationClient client) /// Delete the connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -81,17 +84,25 @@ internal ConnectionOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteWithHttpMessagesAsync(string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -114,6 +125,7 @@ internal ConnectionOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); @@ -123,7 +135,7 @@ internal ConnectionOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -256,6 +268,9 @@ internal ConnectionOperations(AutomationClient client) /// Retrieve the connection identified by connection name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -283,17 +298,25 @@ internal ConnectionOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -316,6 +339,7 @@ internal ConnectionOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("apiVersion", apiVersion); @@ -325,7 +349,7 @@ internal ConnectionOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -458,6 +482,9 @@ internal ConnectionOperations(AutomationClient client) /// Create or update a connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -488,17 +515,25 @@ internal ConnectionOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -529,6 +564,7 @@ internal ConnectionOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("parameters", parameters); @@ -539,7 +575,7 @@ internal ConnectionOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -696,6 +732,9 @@ internal ConnectionOperations(AutomationClient client) /// Update a connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -726,17 +765,25 @@ internal ConnectionOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -763,6 +810,7 @@ internal ConnectionOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionName", connectionName); tracingParameters.Add("parameters", parameters); @@ -773,7 +821,7 @@ internal ConnectionOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionName}", System.Uri.EscapeDataString(connectionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -912,6 +960,9 @@ internal ConnectionOperations(AutomationClient client) /// Retrieve a list of connections. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -936,17 +987,25 @@ internal ConnectionOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -965,6 +1024,7 @@ internal ConnectionOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -973,7 +1033,7 @@ internal ConnectionOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperationsExtensions.cs index 4fbcfe8fa382..bde975a8dde5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ConnectionOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class ConnectionOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of connection. /// - public static Connection Delete(this IConnectionOperations operations, string automationAccountName, string connectionName) + public static Connection Delete(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName) { - return operations.DeleteAsync(automationAccountName, connectionName).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, automationAccountName, connectionName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static Connection Delete(this IConnectionOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static Connection Delete(this IConnectionOperations operations, string au /// /// The cancellation token. /// - public static async Task DeleteAsync(this IConnectionOperations operations, string automationAccountName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(automationAccountName, connectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -70,15 +76,18 @@ public static Connection Delete(this IConnectionOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of connection. /// - public static Connection Get(this IConnectionOperations operations, string automationAccountName, string connectionName) + public static Connection Get(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName) { - return operations.GetAsync(automationAccountName, connectionName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, connectionName).GetAwaiter().GetResult(); } /// @@ -88,6 +97,9 @@ public static Connection Get(this IConnectionOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -97,9 +109,9 @@ public static Connection Get(this IConnectionOperations operations, string autom /// /// The cancellation token. /// - public static async Task GetAsync(this IConnectionOperations operations, string automationAccountName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, connectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -112,6 +124,9 @@ public static Connection Get(this IConnectionOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -121,9 +136,9 @@ public static Connection Get(this IConnectionOperations operations, string autom /// /// The parameters supplied to the create or update connection operation. /// - public static Connection CreateOrUpdate(this IConnectionOperations operations, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters) + public static Connection CreateOrUpdate(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, connectionName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, connectionName, parameters).GetAwaiter().GetResult(); } /// @@ -133,6 +148,9 @@ public static Connection CreateOrUpdate(this IConnectionOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -145,9 +163,9 @@ public static Connection CreateOrUpdate(this IConnectionOperations operations, s /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IConnectionOperations operations, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -160,6 +178,9 @@ public static Connection CreateOrUpdate(this IConnectionOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -169,9 +190,9 @@ public static Connection CreateOrUpdate(this IConnectionOperations operations, s /// /// The parameters supplied to the update a connection operation. /// - public static Connection Update(this IConnectionOperations operations, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters) + public static Connection Update(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, connectionName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, connectionName, parameters).GetAwaiter().GetResult(); } /// @@ -181,6 +202,9 @@ public static Connection Update(this IConnectionOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -193,9 +217,9 @@ public static Connection Update(this IConnectionOperations operations, string au /// /// The cancellation token. /// - public static async Task UpdateAsync(this IConnectionOperations operations, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -208,12 +232,15 @@ public static Connection Update(this IConnectionOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IConnectionOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IConnectionOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -223,15 +250,18 @@ public static IPage ListByAutomationAccount(this IConnectionOperatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IConnectionOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IConnectionOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperations.cs index cb6a414f3031..8763f214460e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperations.cs @@ -54,6 +54,9 @@ internal ConnectionTypeOperations(AutomationClient client) /// Delete the connectiontype. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal ConnectionTypeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -111,6 +122,7 @@ internal ConnectionTypeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionTypeName", connectionTypeName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,7 +132,7 @@ internal ConnectionTypeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionTypeName}", System.Uri.EscapeDataString(connectionTypeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -235,6 +247,9 @@ internal ConnectionTypeOperations(AutomationClient client) /// Retrieve the connectiontype identified by connectiontype name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -262,17 +277,25 @@ internal ConnectionTypeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -295,6 +318,7 @@ internal ConnectionTypeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionTypeName", connectionTypeName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,7 +328,7 @@ internal ConnectionTypeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionTypeName}", System.Uri.EscapeDataString(connectionTypeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -437,6 +461,9 @@ internal ConnectionTypeOperations(AutomationClient client) /// Create a connectiontype. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -467,17 +494,25 @@ internal ConnectionTypeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -508,6 +543,7 @@ internal ConnectionTypeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("connectionTypeName", connectionTypeName); tracingParameters.Add("parameters", parameters); @@ -518,7 +554,7 @@ internal ConnectionTypeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{connectionTypeName}", System.Uri.EscapeDataString(connectionTypeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -675,6 +711,9 @@ internal ConnectionTypeOperations(AutomationClient client) /// Retrieve a list of connectiontypes. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -699,17 +738,25 @@ internal ConnectionTypeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -728,6 +775,7 @@ internal ConnectionTypeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -736,7 +784,7 @@ internal ConnectionTypeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperationsExtensions.cs index 293f94b7c8e6..06d61d53edb9 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ConnectionTypeOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class ConnectionTypeOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of connectiontype. /// - public static void Delete(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName) + public static void Delete(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName) { - operations.DeleteAsync(automationAccountName, connectionTypeName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, connectionTypeName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this IConnectionTypeOperations operations, string auto /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this IConnectionTypeOperations operations, string auto /// /// The cancellation token. /// - public static async Task DeleteAsync(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, connectionTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this IConnectionTypeOperations operations, string auto /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of connectiontype. /// - public static ConnectionType Get(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName) + public static ConnectionType Get(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName) { - return operations.GetAsync(automationAccountName, connectionTypeName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, connectionTypeName).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static ConnectionType Get(this IConnectionTypeOperations operations, stri /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static ConnectionType Get(this IConnectionTypeOperations operations, stri /// /// The cancellation token. /// - public static async Task GetAsync(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, connectionTypeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionTypeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static ConnectionType Get(this IConnectionTypeOperations operations, stri /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static ConnectionType Get(this IConnectionTypeOperations operations, stri /// /// The parameters supplied to the create or update connectiontype operation. /// - public static ConnectionType CreateOrUpdate(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters) + public static ConnectionType CreateOrUpdate(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, connectionTypeName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, connectionTypeName, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static ConnectionType CreateOrUpdate(this IConnectionTypeOperations opera /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static ConnectionType CreateOrUpdate(this IConnectionTypeOperations opera /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IConnectionTypeOperations operations, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, connectionTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, connectionTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,12 +175,15 @@ public static ConnectionType CreateOrUpdate(this IConnectionTypeOperations opera /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IConnectionTypeOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -172,15 +193,18 @@ public static IPage ListByAutomationAccount(this IConnectionType /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IConnectionTypeOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IConnectionTypeOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/CredentialOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/CredentialOperations.cs index 8c9a1a382f2c..7228c788427c 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/CredentialOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/CredentialOperations.cs @@ -54,6 +54,9 @@ internal CredentialOperations(AutomationClient client) /// Delete the credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal CredentialOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -111,6 +122,7 @@ internal CredentialOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("credentialName", credentialName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,7 +132,7 @@ internal CredentialOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -235,6 +247,9 @@ internal CredentialOperations(AutomationClient client) /// Retrieve the credential identified by credential name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -262,17 +277,25 @@ internal CredentialOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -295,6 +318,7 @@ internal CredentialOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("credentialName", credentialName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,7 +328,7 @@ internal CredentialOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -437,6 +461,9 @@ internal CredentialOperations(AutomationClient client) /// Create a credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -467,17 +494,25 @@ internal CredentialOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -508,6 +543,7 @@ internal CredentialOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("credentialName", credentialName); tracingParameters.Add("parameters", parameters); @@ -518,7 +554,7 @@ internal CredentialOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -675,6 +711,9 @@ internal CredentialOperations(AutomationClient client) /// Update a credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -705,17 +744,25 @@ internal CredentialOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string credentialName, CredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -742,6 +789,7 @@ internal CredentialOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("credentialName", credentialName); tracingParameters.Add("parameters", parameters); @@ -752,7 +800,7 @@ internal CredentialOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -891,6 +939,9 @@ internal CredentialOperations(AutomationClient client) /// Retrieve a list of credentials. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -915,17 +966,25 @@ internal CredentialOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -944,6 +1003,7 @@ internal CredentialOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -952,7 +1012,7 @@ internal CredentialOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/CredentialOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/CredentialOperationsExtensions.cs index 7cd77a2f20b3..c92338b6e6e8 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/CredentialOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/CredentialOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class CredentialOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of credential. /// - public static void Delete(this ICredentialOperations operations, string automationAccountName, string credentialName) + public static void Delete(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName) { - operations.DeleteAsync(automationAccountName, credentialName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, credentialName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this ICredentialOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this ICredentialOperations operations, string automati /// /// The cancellation token. /// - public static async Task DeleteAsync(this ICredentialOperations operations, string automationAccountName, string credentialName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, credentialName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this ICredentialOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of credential. /// - public static Credential Get(this ICredentialOperations operations, string automationAccountName, string credentialName) + public static Credential Get(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName) { - return operations.GetAsync(automationAccountName, credentialName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, credentialName).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static Credential Get(this ICredentialOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static Credential Get(this ICredentialOperations operations, string autom /// /// The cancellation token. /// - public static async Task GetAsync(this ICredentialOperations operations, string automationAccountName, string credentialName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, credentialName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static Credential Get(this ICredentialOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static Credential Get(this ICredentialOperations operations, string autom /// /// The parameters supplied to the create or update credential operation. /// - public static Credential CreateOrUpdate(this ICredentialOperations operations, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters) + public static Credential CreateOrUpdate(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, credentialName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, credentialName, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static Credential CreateOrUpdate(this ICredentialOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static Credential CreateOrUpdate(this ICredentialOperations operations, s /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ICredentialOperations operations, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,6 +175,9 @@ public static Credential CreateOrUpdate(this ICredentialOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -166,9 +187,9 @@ public static Credential CreateOrUpdate(this ICredentialOperations operations, s /// /// The parameters supplied to the Update credential operation. /// - public static Credential Update(this ICredentialOperations operations, string automationAccountName, string credentialName, CredentialUpdateParameters parameters) + public static Credential Update(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, credentialName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, credentialName, parameters).GetAwaiter().GetResult(); } /// @@ -178,6 +199,9 @@ public static Credential Update(this ICredentialOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -190,9 +214,9 @@ public static Credential Update(this ICredentialOperations operations, string au /// /// The cancellation token. /// - public static async Task UpdateAsync(this ICredentialOperations operations, string automationAccountName, string credentialName, CredentialUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -205,12 +229,15 @@ public static Credential Update(this ICredentialOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this ICredentialOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this ICredentialOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -220,15 +247,18 @@ public static IPage ListByAutomationAccount(this ICredentialOperatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this ICredentialOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this ICredentialOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperations.cs index e7f3865a78f7..d532e462f668 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -54,16 +55,45 @@ internal DscCompilationJobOperations(AutomationClient client) /// Creates the Dsc compilation job of the configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// + /// /// The the DSC configuration Id. /// /// /// The parameters supplied to the create compilation job operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, compilationJobName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve the Dsc configuration compilation job identified by job id. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The the DSC configuration Id. + /// + /// /// Headers that will be added to request. /// /// @@ -84,36 +114,40 @@ internal DscCompilationJobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid compilationJobId, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (compilationJobName == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "compilationJobName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -121,19 +155,19 @@ internal DscCompilationJobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("compilationJobId", compilationJobId); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("compilationJobName", compilationJobName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{compilationJobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(compilationJobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{compilationJobName}", System.Uri.EscapeDataString(compilationJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -147,7 +181,7 @@ internal DscCompilationJobOperations(AutomationClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -178,12 +212,6 @@ internal DscCompilationJobOperations(AutomationClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -204,7 +232,7 @@ internal DscCompilationJobOperations(AutomationClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -242,7 +270,7 @@ internal DscCompilationJobOperations(AutomationClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -267,14 +295,17 @@ internal DscCompilationJobOperations(AutomationClient client) } /// - /// Retrieve the Dsc configuration compilation job identified by job id. - /// + /// Retrieve a list of dsc compilation jobs. + /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The Dsc configuration compilation job id. + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -297,17 +328,25 @@ internal DscCompilationJobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid compilationJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -318,7 +357,7 @@ internal DscCompilationJobOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -326,20 +365,28 @@ internal DscCompilationJobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("compilationJobId", compilationJobId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{compilationJobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(compilationJobId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -432,7 +479,7 @@ internal DscCompilationJobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -445,7 +492,7 @@ internal DscCompilationJobOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -465,14 +512,20 @@ internal DscCompilationJobOperations(AutomationClient client) } /// - /// Retrieve a list of dsc compilation jobs. - /// + /// Retrieve the job stream identified by job stream id. + /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// The job id. + /// + /// + /// The job stream id. /// /// /// Headers that will be added to request. @@ -495,28 +548,40 @@ internal DscCompilationJobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStreamWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } + if (jobStreamId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobStreamId"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -524,23 +589,23 @@ internal DscCompilationJobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("filter", filter); + tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobStreamId", jobStreamId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStream", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{jobStreamId}", System.Uri.EscapeDataString(jobStreamId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -633,7 +698,7 @@ internal DscCompilationJobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -646,7 +711,7 @@ internal DscCompilationJobOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -666,17 +731,20 @@ internal DscCompilationJobOperations(AutomationClient client) } /// - /// Retrieve the job stream identified by job stream id. - /// + /// Creates the Dsc compilation job of the configuration. + /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The the DSC configuration Id. /// - /// - /// The job stream id. + /// + /// The parameters supplied to the create compilation job operation. /// /// /// Headers that will be added to request. @@ -699,32 +767,48 @@ internal DscCompilationJobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetStreamWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (jobStreamId == null) + if (compilationJobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobStreamId"); + throw new ValidationException(ValidationRules.CannotBeNull, "compilationJobName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -732,20 +816,20 @@ internal DscCompilationJobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); - tracingParameters.Add("jobStreamId", jobStreamId); + tracingParameters.Add("compilationJobName", compilationJobName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStream", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{jobStreamId}", System.Uri.EscapeDataString(jobStreamId)); + _url = _url.Replace("{compilationJobName}", System.Uri.EscapeDataString(compilationJobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -759,7 +843,7 @@ internal DscCompilationJobOperations(AutomationClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -790,6 +874,12 @@ internal DscCompilationJobOperations(AutomationClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -810,7 +900,7 @@ internal DscCompilationJobOperations(AutomationClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -840,7 +930,7 @@ internal DscCompilationJobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -848,12 +938,12 @@ internal DscCompilationJobOperations(AutomationClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperationsExtensions.cs index 53ed6cd778cd..5bd975435e8d 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobOperationsExtensions.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Threading; using System.Threading.Tasks; @@ -28,18 +29,21 @@ public static partial class DscCompilationJobOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// + /// /// The the DSC configuration Id. /// /// /// The parameters supplied to the create compilation job operation. /// - public static DscCompilationJob Create(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid compilationJobId, DscCompilationJobCreateParameters parameters) + public static DscCompilationJob Create(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters) { - return operations.CreateAsync(automationAccountName, compilationJobId, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, automationAccountName, compilationJobName, parameters).GetAwaiter().GetResult(); } /// @@ -49,10 +53,13 @@ public static DscCompilationJob Create(this IDscCompilationJobOperations operati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// + /// /// The the DSC configuration Id. /// /// @@ -61,9 +68,9 @@ public static DscCompilationJob Create(this IDscCompilationJobOperations operati /// /// The cancellation token. /// - public static async Task CreateAsync(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid compilationJobId, DscCompilationJobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(automationAccountName, compilationJobId, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, compilationJobName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,15 +83,18 @@ public static DscCompilationJob Create(this IDscCompilationJobOperations operati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The Dsc configuration compilation job id. + /// + /// The the DSC configuration Id. /// - public static DscCompilationJob Get(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid compilationJobId) + public static DscCompilationJob Get(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName) { - return operations.GetAsync(automationAccountName, compilationJobId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, compilationJobName).GetAwaiter().GetResult(); } /// @@ -94,18 +104,21 @@ public static DscCompilationJob Get(this IDscCompilationJobOperations operations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The Dsc configuration compilation job id. + /// + /// The the DSC configuration Id. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid compilationJobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, compilationJobId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, compilationJobName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -118,15 +131,18 @@ public static DscCompilationJob Get(this IDscCompilationJobOperations operations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// - public static IPage ListByAutomationAccount(this IDscCompilationJobOperations operations, string automationAccountName, string filter = default(string)) + public static IPage ListByAutomationAccount(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery)) { - return operations.ListByAutomationAccountAsync(automationAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, odataQuery).GetAwaiter().GetResult(); } /// @@ -136,18 +152,21 @@ public static DscCompilationJob Get(this IDscCompilationJobOperations operations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IDscCompilationJobOperations operations, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -160,8 +179,11 @@ public static DscCompilationJob Get(this IDscCompilationJobOperations operations /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The job id. @@ -169,9 +191,9 @@ public static DscCompilationJob Get(this IDscCompilationJobOperations operations /// /// The job stream id. /// - public static JobStream GetStream(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid jobId, string jobStreamId) + public static JobStream GetStream(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobId, string jobStreamId) { - return operations.GetStreamAsync(automationAccountName, jobId, jobStreamId).GetAwaiter().GetResult(); + return operations.GetStreamAsync(resourceGroupName, automationAccountName, jobId, jobStreamId).GetAwaiter().GetResult(); } /// @@ -181,8 +203,11 @@ public static JobStream GetStream(this IDscCompilationJobOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The job id. @@ -193,9 +218,63 @@ public static JobStream GetStream(this IDscCompilationJobOperations operations, /// /// The cancellation token. /// - public static async Task GetStreamAsync(this IDscCompilationJobOperations operations, string automationAccountName, System.Guid jobId, string jobStreamId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetStreamAsync(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobId, string jobStreamId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetStreamWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobId, jobStreamId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates the Dsc compilation job of the configuration. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The the DSC configuration Id. + /// + /// + /// The parameters supplied to the create compilation job operation. + /// + public static DscCompilationJob BeginCreate(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters) + { + return operations.BeginCreateAsync(resourceGroupName, automationAccountName, compilationJobName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates the Dsc compilation job of the configuration. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The the DSC configuration Id. + /// + /// + /// The parameters supplied to the create compilation job operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IDscCompilationJobOperations operations, string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStreamWithHttpMessagesAsync(automationAccountName, jobId, jobStreamId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, compilationJobName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperations.cs new file mode 100644 index 000000000000..44b724260913 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperations.cs @@ -0,0 +1,264 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DscCompilationJobStreamOperations operations. + /// + internal partial class DscCompilationJobStreamOperations : IServiceOperations, IDscCompilationJobStreamOperations + { + /// + /// Initializes a new instance of the DscCompilationJobStreamOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DscCompilationJobStreamOperations(AutomationClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AutomationClient + /// + public AutomationClient Client { get; private set; } + + /// + /// Retrieve all the job streams for the compilation Job. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The job id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-01-15"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("jobId", jobId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByJob", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperationsExtensions.cs new file mode 100644 index 000000000000..81732ece92c4 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/DscCompilationJobStreamOperationsExtensions.cs @@ -0,0 +1,73 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DscCompilationJobStreamOperations. + /// + public static partial class DscCompilationJobStreamOperationsExtensions + { + /// + /// Retrieve all the job streams for the compilation Job. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The job id. + /// + public static JobStreamListResult ListByJob(this IDscCompilationJobStreamOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobId) + { + return operations.ListByJobAsync(resourceGroupName, automationAccountName, jobId).GetAwaiter().GetResult(); + } + + /// + /// Retrieve all the job streams for the compilation Job. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The job id. + /// + /// + /// The cancellation token. + /// + public static async Task ListByJobAsync(this IDscCompilationJobStreamOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByJobWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperations.cs index 8512419e910a..7f93d9a8e461 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperations.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Automation using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -55,6 +54,9 @@ internal DscConfigurationOperations(AutomationClient client) /// Delete the dsc configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -79,17 +81,25 @@ internal DscConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -112,6 +122,7 @@ internal DscConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("apiVersion", apiVersion); @@ -121,7 +132,7 @@ internal DscConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -236,6 +247,9 @@ internal DscConfigurationOperations(AutomationClient client) /// Retrieve the configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -263,17 +277,25 @@ internal DscConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -296,6 +318,7 @@ internal DscConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("apiVersion", apiVersion); @@ -305,7 +328,7 @@ internal DscConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -438,6 +461,9 @@ internal DscConfigurationOperations(AutomationClient client) /// Create the configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -468,17 +494,25 @@ internal DscConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -509,6 +543,7 @@ internal DscConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("parameters", parameters); @@ -519,7 +554,7 @@ internal DscConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -672,10 +707,237 @@ internal DscConfigurationOperations(AutomationClient client) return _result; } + /// + /// Create the configuration identified by configuration name. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationUpdateParameters parameters = default(DscConfigurationUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-10-31"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Retrieve the configuration script identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -703,17 +965,25 @@ internal DscConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContentWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -736,6 +1006,7 @@ internal DscConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("apiVersion", apiVersion); @@ -745,7 +1016,7 @@ internal DscConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -804,7 +1075,7 @@ internal DscConfigurationOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -842,7 +1113,7 @@ internal DscConfigurationOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -852,7 +1123,20 @@ internal DscConfigurationOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -865,6 +1149,9 @@ internal DscConfigurationOperations(AutomationClient client) /// Retrieve a list of configurations. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -889,17 +1176,25 @@ internal DscConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -918,6 +1213,7 @@ internal DscConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -926,7 +1222,7 @@ internal DscConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperationsExtensions.cs index b21db079a393..c4efabc02da2 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscConfigurationOperationsExtensions.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Management.Automation using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -29,15 +28,18 @@ public static partial class DscConfigurationOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The configuration name. /// - public static void Delete(this IDscConfigurationOperations operations, string automationAccountName, string configurationName) + public static void Delete(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName) { - operations.DeleteAsync(automationAccountName, configurationName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, configurationName).GetAwaiter().GetResult(); } /// @@ -47,6 +49,9 @@ public static void Delete(this IDscConfigurationOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -56,9 +61,9 @@ public static void Delete(this IDscConfigurationOperations operations, string au /// /// The cancellation token. /// - public static async Task DeleteAsync(this IDscConfigurationOperations operations, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -68,15 +73,18 @@ public static void Delete(this IDscConfigurationOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The configuration name. /// - public static DscConfiguration Get(this IDscConfigurationOperations operations, string automationAccountName, string configurationName) + public static DscConfiguration Get(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName) { - return operations.GetAsync(automationAccountName, configurationName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, configurationName).GetAwaiter().GetResult(); } /// @@ -86,6 +94,9 @@ public static DscConfiguration Get(this IDscConfigurationOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -95,9 +106,9 @@ public static DscConfiguration Get(this IDscConfigurationOperations operations, /// /// The cancellation token. /// - public static async Task GetAsync(this IDscConfigurationOperations operations, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -110,6 +121,9 @@ public static DscConfiguration Get(this IDscConfigurationOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -119,9 +133,9 @@ public static DscConfiguration Get(this IDscConfigurationOperations operations, /// /// The create or update parameters for configuration. /// - public static DscConfiguration CreateOrUpdate(this IDscConfigurationOperations operations, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters) + public static DscConfiguration CreateOrUpdate(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, configurationName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, configurationName, parameters).GetAwaiter().GetResult(); } /// @@ -131,6 +145,9 @@ public static DscConfiguration CreateOrUpdate(this IDscConfigurationOperations o /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -143,9 +160,63 @@ public static DscConfiguration CreateOrUpdate(this IDscConfigurationOperations o /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDscConfigurationOperations operations, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, configurationName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, configurationName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create the configuration identified by configuration name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The create or update parameters for configuration. + /// + public static DscConfiguration Update(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationUpdateParameters parameters = default(DscConfigurationUpdateParameters)) + { + return operations.UpdateAsync(resourceGroupName, automationAccountName, configurationName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create the configuration identified by configuration name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationUpdateParameters parameters = default(DscConfigurationUpdateParameters), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, configurationName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -158,15 +229,18 @@ public static DscConfiguration CreateOrUpdate(this IDscConfigurationOperations o /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The configuration name. /// - public static Stream GetContent(this IDscConfigurationOperations operations, string automationAccountName, string configurationName) + public static string GetContent(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName) { - return operations.GetContentAsync(automationAccountName, configurationName).GetAwaiter().GetResult(); + return operations.GetContentAsync(resourceGroupName, automationAccountName, configurationName).GetAwaiter().GetResult(); } /// @@ -176,6 +250,9 @@ public static Stream GetContent(this IDscConfigurationOperations operations, str /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -185,11 +262,12 @@ public static Stream GetContent(this IDscConfigurationOperations operations, str /// /// The cancellation token. /// - public static async Task GetContentAsync(this IDscConfigurationOperations operations, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetContentAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetContentWithHttpMessagesAsync(automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -199,12 +277,15 @@ public static Stream GetContent(this IDscConfigurationOperations operations, str /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IDscConfigurationOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -214,15 +295,18 @@ public static IPage ListByAutomationAccount(this IDscConfigura /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IDscConfigurationOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IDscConfigurationOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperations.cs index abd84fae1153..da408af21ab5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -54,8 +55,11 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// Delete the Dsc node configurations by node configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -78,17 +82,29 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -99,11 +115,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "nodeConfigurationName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,6 +123,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeConfigurationName", nodeConfigurationName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,10 +133,10 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeConfigurationName}", System.Uri.EscapeDataString(nodeConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -235,8 +248,11 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// Retrieve the Dsc node configurations by node configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -262,17 +278,29 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -283,11 +311,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "nodeConfigurationName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,6 +319,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeConfigurationName", nodeConfigurationName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,10 +329,10 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeConfigurationName}", System.Uri.EscapeDataString(nodeConfigurationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -437,16 +462,45 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// Create the node configuration identified by node configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// - /// The create or update parameters for configuration. + /// The Dsc node configuration name. /// /// /// The create or update parameters for configuration. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieve a list of dsc node configurations. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// OData parameters to apply to the operation. + /// + /// /// Headers that will be added to request. /// /// @@ -467,40 +521,36 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (nodeConfigurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nodeConfigurationName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -508,21 +558,28 @@ internal DscNodeConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("nodeConfigurationName", nodeConfigurationName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{nodeConfigurationName}", System.Uri.EscapeDataString(nodeConfigurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -534,7 +591,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -565,12 +622,6 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -591,7 +642,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -621,7 +672,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -634,25 +685,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -672,14 +705,20 @@ internal DscNodeConfigurationOperations(AutomationClient client) } /// - /// Retrieve a list of dsc node configurations. + /// Create the node configuration identified by node configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// The Dsc node configuration name. + /// + /// + /// The create or update parameters for configuration. /// /// /// Headers that will be added to request. @@ -702,28 +741,48 @@ internal DscNodeConfigurationOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } + if (nodeConfigurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nodeConfigurationName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -731,23 +790,22 @@ internal DscNodeConfigurationOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("filter", filter); + tracingParameters.Add("nodeConfigurationName", nodeConfigurationName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{nodeConfigurationName}", System.Uri.EscapeDataString(nodeConfigurationName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -759,7 +817,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -790,6 +848,12 @@ internal DscNodeConfigurationOperations(AutomationClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -810,7 +874,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -840,7 +904,7 @@ internal DscNodeConfigurationOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -848,12 +912,12 @@ internal DscNodeConfigurationOperations(AutomationClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperationsExtensions.cs index f0a39537af77..847d8ad8ae6b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscNodeConfigurationOperationsExtensions.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Threading; using System.Threading.Tasks; @@ -28,15 +29,18 @@ public static partial class DscNodeConfigurationOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. /// - public static void Delete(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName) + public static void Delete(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName) { - operations.DeleteAsync(automationAccountName, nodeConfigurationName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, nodeConfigurationName).GetAwaiter().GetResult(); } /// @@ -46,8 +50,11 @@ public static void Delete(this IDscNodeConfigurationOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -55,9 +62,9 @@ public static void Delete(this IDscNodeConfigurationOperations operations, strin /// /// The cancellation token. /// - public static async Task DeleteAsync(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +74,18 @@ public static void Delete(this IDscNodeConfigurationOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. /// - public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName) + public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName) { - return operations.GetAsync(automationAccountName, nodeConfigurationName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, nodeConfigurationName).GetAwaiter().GetResult(); } /// @@ -85,8 +95,11 @@ public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations oper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -94,9 +107,9 @@ public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations oper /// /// The cancellation token. /// - public static async Task GetAsync(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,18 +122,21 @@ public static DscNodeConfiguration Get(this IDscNodeConfigurationOperations oper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// - /// The create or update parameters for configuration. + /// The Dsc node configuration name. /// /// /// The create or update parameters for configuration. /// - public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters) + public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, nodeConfigurationName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters).GetAwaiter().GetResult(); } /// @@ -130,11 +146,14 @@ public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// - /// The create or update parameters for configuration. + /// The Dsc node configuration name. /// /// /// The create or update parameters for configuration. @@ -142,9 +161,9 @@ public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOper /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDscNodeConfigurationOperations operations, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, nodeConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,15 +176,18 @@ public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// - public static IPage ListByAutomationAccount(this IDscNodeConfigurationOperations operations, string automationAccountName, string filter = default(string)) + public static IPage ListByAutomationAccount(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery)) { - return operations.ListByAutomationAccountAsync(automationAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, odataQuery).GetAwaiter().GetResult(); } /// @@ -175,18 +197,75 @@ public static DscNodeConfiguration CreateOrUpdate(this IDscNodeConfigurationOper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create the node configuration identified by node configuration name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The Dsc node configuration name. + /// + /// + /// The create or update parameters for configuration. + /// + public static DscNodeConfiguration BeginCreateOrUpdate(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create the node configuration identified by node configuration name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// The Dsc node configuration name. + /// + /// + /// The create or update parameters for configuration. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IDscNodeConfigurationOperations operations, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IDscNodeConfigurationOperations operations, string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperations.cs index 5a0866f98f8c..25b4421baaf2 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -54,8 +55,11 @@ internal DscNodeOperations(AutomationClient client) /// Delete the dsc node identified by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// Automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -81,17 +85,25 @@ internal DscNodeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteWithHttpMessagesAsync(string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -106,7 +118,7 @@ internal DscNodeOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,6 +126,7 @@ internal DscNodeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("apiVersion", apiVersion); @@ -123,7 +136,7 @@ internal DscNodeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -256,8 +269,11 @@ internal DscNodeOperations(AutomationClient client) /// Retrieve the dsc node identified by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -283,17 +299,25 @@ internal DscNodeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -308,7 +332,7 @@ internal DscNodeOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -316,6 +340,7 @@ internal DscNodeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("apiVersion", apiVersion); @@ -325,7 +350,7 @@ internal DscNodeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -458,13 +483,16 @@ internal DscNodeOperations(AutomationClient client) /// Update the dsc node. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// Parameters supplied to the update dsc node. /// - /// + /// /// Parameters supplied to the update dsc node. /// /// @@ -488,17 +516,25 @@ internal DscNodeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string nodeId, DscNodeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, DscNodeUpdateParameters dscNodeUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -509,15 +545,15 @@ internal DscNodeOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "nodeId"); } - if (parameters == null) + if (dscNodeUpdateParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "dscNodeUpdateParameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -525,9 +561,10 @@ internal DscNodeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("dscNodeUpdateParameters", dscNodeUpdateParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); @@ -535,7 +572,7 @@ internal DscNodeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -582,9 +619,9 @@ internal DscNodeOperations(AutomationClient client) // Serialize Request string _requestContent = null; - if(parameters != null) + if(dscNodeUpdateParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dscNodeUpdateParameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -674,11 +711,14 @@ internal DscNodeOperations(AutomationClient client) /// Retrieve a list of dsc nodes. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -701,17 +741,25 @@ internal DscNodeOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -722,7 +770,7 @@ internal DscNodeOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -730,8 +778,9 @@ internal DscNodeOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("filter", filter); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); @@ -739,13 +788,17 @@ internal DscNodeOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) + if (odataQuery != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } } if (apiVersion != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperationsExtensions.cs index ab5432ec06de..4f012a297b8a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/DscNodeOperationsExtensions.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Threading; using System.Threading.Tasks; @@ -28,15 +29,18 @@ public static partial class DscNodeOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// Automation account name. + /// The name of the automation account. /// /// /// The node id. /// - public static DscNode Delete(this IDscNodeOperations operations, string automationAccountName, string nodeId) + public static DscNode Delete(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId) { - return operations.DeleteAsync(automationAccountName, nodeId).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, automationAccountName, nodeId).GetAwaiter().GetResult(); } /// @@ -46,8 +50,11 @@ public static DscNode Delete(this IDscNodeOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// Automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -55,9 +62,9 @@ public static DscNode Delete(this IDscNodeOperations operations, string automati /// /// The cancellation token. /// - public static async Task DeleteAsync(this IDscNodeOperations operations, string automationAccountName, string nodeId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(automationAccountName, nodeId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -70,15 +77,18 @@ public static DscNode Delete(this IDscNodeOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The node id. /// - public static DscNode Get(this IDscNodeOperations operations, string automationAccountName, string nodeId) + public static DscNode Get(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId) { - return operations.GetAsync(automationAccountName, nodeId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, nodeId).GetAwaiter().GetResult(); } /// @@ -88,8 +98,11 @@ public static DscNode Get(this IDscNodeOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -97,9 +110,9 @@ public static DscNode Get(this IDscNodeOperations operations, string automationA /// /// The cancellation token. /// - public static async Task GetAsync(this IDscNodeOperations operations, string automationAccountName, string nodeId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, nodeId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -112,18 +125,21 @@ public static DscNode Get(this IDscNodeOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// Parameters supplied to the update dsc node. /// - /// + /// /// Parameters supplied to the update dsc node. /// - public static DscNode Update(this IDscNodeOperations operations, string automationAccountName, string nodeId, DscNodeUpdateParameters parameters) + public static DscNode Update(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId, DscNodeUpdateParameters dscNodeUpdateParameters) { - return operations.UpdateAsync(automationAccountName, nodeId, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, nodeId, dscNodeUpdateParameters).GetAwaiter().GetResult(); } /// @@ -133,21 +149,24 @@ public static DscNode Update(this IDscNodeOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// Parameters supplied to the update dsc node. /// - /// + /// /// Parameters supplied to the update dsc node. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IDscNodeOperations operations, string automationAccountName, string nodeId, DscNodeUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, string nodeId, DscNodeUpdateParameters dscNodeUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, nodeId, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, dscNodeUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -160,15 +179,18 @@ public static DscNode Update(this IDscNodeOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// - public static IPage ListByAutomationAccount(this IDscNodeOperations operations, string automationAccountName, string filter = default(string)) + public static IPage ListByAutomationAccount(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery)) { - return operations.ListByAutomationAccountAsync(automationAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, odataQuery).GetAwaiter().GetResult(); } /// @@ -178,18 +200,21 @@ public static DscNode Update(this IDscNodeOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IDscNodeOperations operations, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IDscNodeOperations operations, string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/FieldsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/FieldsOperations.cs index 72aaab0c7bd6..c12fb0228b3d 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/FieldsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/FieldsOperations.cs @@ -54,6 +54,9 @@ internal FieldsOperations(AutomationClient client) /// Retrieve a list of fields of a given type identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +87,25 @@ internal FieldsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByTypeWithHttpMessagesAsync(string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -121,6 +132,7 @@ internal FieldsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("typeName", typeName); @@ -131,7 +143,7 @@ internal FieldsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{typeName}", System.Uri.EscapeDataString(typeName)); diff --git a/src/SDKs/Automation/Management.Automation/Generated/FieldsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/FieldsOperationsExtensions.cs index db610b1f6da4..6446e8411192 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/FieldsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/FieldsOperationsExtensions.cs @@ -30,6 +30,9 @@ public static partial class FieldsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -39,9 +42,9 @@ public static partial class FieldsOperationsExtensions /// /// The name of type. /// - public static IEnumerable ListByType(this IFieldsOperations operations, string automationAccountName, string moduleName, string typeName) + public static IEnumerable ListByType(this IFieldsOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string typeName) { - return operations.ListByTypeAsync(automationAccountName, moduleName, typeName).GetAwaiter().GetResult(); + return operations.ListByTypeAsync(resourceGroupName, automationAccountName, moduleName, typeName).GetAwaiter().GetResult(); } /// @@ -51,6 +54,9 @@ public static IEnumerable ListByType(this IFieldsOperations operation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -63,9 +69,9 @@ public static IEnumerable ListByType(this IFieldsOperations operation /// /// The cancellation token. /// - public static async Task> ListByTypeAsync(this IFieldsOperations operations, string automationAccountName, string moduleName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByTypeAsync(this IFieldsOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByTypeWithHttpMessagesAsync(automationAccountName, moduleName, typeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByTypeWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, typeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperations.cs index 005cc71aa669..ab231bb6f5b7 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperations.cs @@ -54,6 +54,9 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// Delete a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// Automation account name. /// @@ -78,17 +81,25 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -111,6 +122,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("hybridRunbookWorkerGroupName", hybridRunbookWorkerGroupName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,7 +132,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{hybridRunbookWorkerGroupName}", System.Uri.EscapeDataString(hybridRunbookWorkerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -235,6 +247,9 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// Retrieve a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -262,17 +277,25 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -295,6 +318,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("hybridRunbookWorkerGroupName", hybridRunbookWorkerGroupName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,7 +328,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{hybridRunbookWorkerGroupName}", System.Uri.EscapeDataString(hybridRunbookWorkerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -437,6 +461,9 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// Update a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -467,17 +494,25 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -504,6 +539,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("hybridRunbookWorkerGroupName", hybridRunbookWorkerGroupName); tracingParameters.Add("parameters", parameters); @@ -514,7 +550,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{hybridRunbookWorkerGroupName}", System.Uri.EscapeDataString(hybridRunbookWorkerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -653,6 +689,9 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// Retrieve a list of hybrid runbook worker groups. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -677,17 +716,25 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -706,6 +753,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -714,7 +762,7 @@ internal HybridRunbookWorkerGroupOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs index 99b726c8b799..2fa573332d0a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/HybridRunbookWorkerGroupOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class HybridRunbookWorkerGroupOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// Automation account name. /// /// /// The hybrid runbook worker group name /// - public static void Delete(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName) + public static void Delete(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName) { - operations.DeleteAsync(automationAccountName, hybridRunbookWorkerGroupName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this IHybridRunbookWorkerGroupOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// Automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this IHybridRunbookWorkerGroupOperations operations, s /// /// The cancellation token. /// - public static async Task DeleteAsync(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, hybridRunbookWorkerGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this IHybridRunbookWorkerGroupOperations operations, s /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The hybrid runbook worker group name /// - public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName) + public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName) { - return operations.GetAsync(automationAccountName, hybridRunbookWorkerGroupName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperati /// /// The cancellation token. /// - public static async Task GetAsync(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, hybridRunbookWorkerGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static HybridRunbookWorkerGroup Get(this IHybridRunbookWorkerGroupOperati /// /// The hybrid runbook worker group /// - public static HybridRunbookWorkerGroup Update(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters) + public static HybridRunbookWorkerGroup Update(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, hybridRunbookWorkerGroupName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static HybridRunbookWorkerGroup Update(this IHybridRunbookWorkerGroupOper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static HybridRunbookWorkerGroup Update(this IHybridRunbookWorkerGroupOper /// /// The cancellation token. /// - public static async Task UpdateAsync(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, hybridRunbookWorkerGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,12 +175,15 @@ public static HybridRunbookWorkerGroup Update(this IHybridRunbookWorkerGroupOper /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -172,15 +193,18 @@ public static IPage ListByAutomationAccount(this IHybr /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IHybridRunbookWorkerGroupOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IHybridRunbookWorkerGroupOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IActivityOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IActivityOperations.cs index c20bf2ed5187..6fe32b63f010 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IActivityOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IActivityOperations.cs @@ -28,6 +28,9 @@ public partial interface IActivityOperations /// activity name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -52,12 +55,15 @@ public partial interface IActivityOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string moduleName, string activityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string activityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of activities in the module identified by module /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -79,7 +85,7 @@ public partial interface IActivityOperations /// /// Thrown when a required parameter is null /// - Task>> ListByModuleWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByModuleWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of activities in the module identified by module /// name. diff --git a/src/SDKs/Automation/Management.Automation/Generated/IAgentRegistrationInformationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IAgentRegistrationInformationOperations.cs index 1b0921828adc..b86c1de25ab6 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IAgentRegistrationInformationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IAgentRegistrationInformationOperations.cs @@ -27,8 +27,11 @@ public partial interface IAgentRegistrationInformationOperations /// Retrieve the automation agent registration information. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The headers that will be added to request. @@ -45,13 +48,16 @@ public partial interface IAgentRegistrationInformationOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Regenerate a primary or secondary agent registration key /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The name of the agent registration key to be regenerated @@ -71,6 +77,6 @@ public partial interface IAgentRegistrationInformationOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeyWithHttpMessagesAsync(string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, AgentRegistrationRegenerateKeyParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IAutomationClient.cs b/src/SDKs/Automation/Management.Automation/Generated/IAutomationClient.cs index 490145256d28..b426c7b840d3 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IAutomationClient.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IAutomationClient.cs @@ -47,21 +47,6 @@ public partial interface IAutomationClient : System.IDisposable /// string SubscriptionId { get; set; } - /// - /// The resource group name. - /// - string ResourceGroupName { get; set; } - - /// - /// Identifies this specific client request. - /// - string ClientRequestId { get; set; } - - /// - /// The name of the automation account. - /// - string AutomationAccountName { get; set; } - /// /// Gets or sets the preferred language for the response. /// @@ -100,6 +85,11 @@ public partial interface IAutomationClient : System.IDisposable /// IUsagesOperations Usages { get; } + /// + /// Gets the IKeysOperations. + /// + IKeysOperations Keys { get; } + /// /// Gets the ICertificateOperations. /// @@ -120,55 +110,25 @@ public partial interface IAutomationClient : System.IDisposable /// ICredentialOperations Credential { get; } - /// - /// Gets the IDscCompilationJobOperations. - /// - IDscCompilationJobOperations DscCompilationJob { get; } - /// /// Gets the IDscConfigurationOperations. /// IDscConfigurationOperations DscConfiguration { get; } - /// - /// Gets the IAgentRegistrationInformationOperations. - /// - IAgentRegistrationInformationOperations AgentRegistrationInformation { get; } - - /// - /// Gets the IDscNodeOperations. - /// - IDscNodeOperations DscNode { get; } - - /// - /// Gets the INodeReportsOperations. - /// - INodeReportsOperations NodeReports { get; } - - /// - /// Gets the IDscNodeConfigurationOperations. - /// - IDscNodeConfigurationOperations DscNodeConfiguration { get; } - /// /// Gets the IHybridRunbookWorkerGroupOperations. /// IHybridRunbookWorkerGroupOperations HybridRunbookWorkerGroup { get; } /// - /// Gets the IJobOperations. - /// - IJobOperations Job { get; } - - /// - /// Gets the IJobStreamOperations. + /// Gets the IJobScheduleOperations. /// - IJobStreamOperations JobStream { get; } + IJobScheduleOperations JobSchedule { get; } /// - /// Gets the IJobScheduleOperations. + /// Gets the ILinkedWorkspaceOperations. /// - IJobScheduleOperations JobSchedule { get; } + ILinkedWorkspaceOperations LinkedWorkspace { get; } /// /// Gets the IActivityOperations. @@ -206,9 +166,9 @@ public partial interface IAutomationClient : System.IDisposable ITestJobStreamsOperations TestJobStreams { get; } /// - /// Gets the ITestJobsOperations. + /// Gets the ITestJobOperations. /// - ITestJobsOperations TestJobs { get; } + ITestJobOperations TestJob { get; } /// /// Gets the IScheduleOperations. @@ -240,5 +200,55 @@ public partial interface IAutomationClient : System.IDisposable /// ISoftwareUpdateConfigurationMachineRunsOperations SoftwareUpdateConfigurationMachineRuns { get; } + /// + /// Gets the ISourceControlOperations. + /// + ISourceControlOperations SourceControl { get; } + + /// + /// Gets the ISourceControlSyncJobOperations. + /// + ISourceControlSyncJobOperations SourceControlSyncJob { get; } + + /// + /// Gets the IJobOperations. + /// + IJobOperations Job { get; } + + /// + /// Gets the IJobStreamOperations. + /// + IJobStreamOperations JobStream { get; } + + /// + /// Gets the IAgentRegistrationInformationOperations. + /// + IAgentRegistrationInformationOperations AgentRegistrationInformation { get; } + + /// + /// Gets the IDscNodeOperations. + /// + IDscNodeOperations DscNode { get; } + + /// + /// Gets the INodeReportsOperations. + /// + INodeReportsOperations NodeReports { get; } + + /// + /// Gets the IDscCompilationJobOperations. + /// + IDscCompilationJobOperations DscCompilationJob { get; } + + /// + /// Gets the IDscCompilationJobStreamOperations. + /// + IDscCompilationJobStreamOperations DscCompilationJobStream { get; } + + /// + /// Gets the IDscNodeConfigurationOperations. + /// + IDscNodeConfigurationOperations DscNodeConfiguration { get; } + } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ICertificateOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ICertificateOperations.cs index 479423b07247..3384ddd1f89f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ICertificateOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ICertificateOperations.cs @@ -27,6 +27,9 @@ public partial interface ICertificateOperations /// Delete the certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the certificate identified by certificate name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create a certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -102,11 +111,14 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, CertificateCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update a certificate. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -131,11 +143,14 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string certificateName, CertificateUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string certificateName, CertificateUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of certificates. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -154,7 +169,7 @@ public partial interface ICertificateOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of certificates. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IConnectionOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IConnectionOperations.cs index 117a49547745..9dfb6e9a96e3 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IConnectionOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IConnectionOperations.cs @@ -27,6 +27,9 @@ public partial interface IConnectionOperations /// Delete the connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -48,11 +51,14 @@ public partial interface IConnectionOperations /// /// Thrown when a required parameter is null /// - Task> DeleteWithHttpMessagesAsync(string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the connection identified by connection name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -74,11 +80,14 @@ public partial interface IConnectionOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update a connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -105,11 +114,14 @@ public partial interface IConnectionOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, ConnectionCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update a connection. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -134,11 +146,14 @@ public partial interface IConnectionOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionName, ConnectionUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of connections. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -157,7 +172,7 @@ public partial interface IConnectionOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of connections. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IConnectionTypeOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IConnectionTypeOperations.cs index a29e5bf1063b..24dcc5c4407a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IConnectionTypeOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IConnectionTypeOperations.cs @@ -27,6 +27,9 @@ public partial interface IConnectionTypeOperations /// Delete the connectiontype. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface IConnectionTypeOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the connectiontype identified by connectiontype name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface IConnectionTypeOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create a connectiontype. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -102,11 +111,14 @@ public partial interface IConnectionTypeOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string connectionTypeName, ConnectionTypeCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of connectiontypes. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -125,7 +137,7 @@ public partial interface IConnectionTypeOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of connectiontypes. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/ICredentialOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ICredentialOperations.cs index 7b555c801a25..e7e8051156b8 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ICredentialOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ICredentialOperations.cs @@ -27,6 +27,9 @@ public partial interface ICredentialOperations /// Delete the credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface ICredentialOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the credential identified by credential name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface ICredentialOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create a credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -102,11 +111,14 @@ public partial interface ICredentialOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, CredentialCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update a credential. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -131,11 +143,14 @@ public partial interface ICredentialOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string credentialName, CredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string credentialName, CredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of credentials. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -154,7 +169,7 @@ public partial interface ICredentialOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of credentials. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobOperations.cs index 48502172c016..8483b75ca4c4 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -27,10 +28,13 @@ public partial interface IDscCompilationJobOperations /// Creates the Dsc compilation job of the configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// + /// /// The the DSC configuration Id. /// /// @@ -51,17 +55,20 @@ public partial interface IDscCompilationJobOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid compilationJobId, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the Dsc configuration compilation job identified by job /// id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The Dsc configuration compilation job id. + /// + /// The the DSC configuration Id. /// /// /// The headers that will be added to request. @@ -78,16 +85,19 @@ public partial interface IDscCompilationJobOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid compilationJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc compilation jobs. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The headers that will be added to request. @@ -104,13 +114,16 @@ public partial interface IDscCompilationJobOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the job stream identified by job stream id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The job id. @@ -133,7 +146,39 @@ public partial interface IDscCompilationJobOperations /// /// Thrown when a required parameter is null /// - Task> GetStreamWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetStreamWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the Dsc compilation job of the configuration. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The the DSC configuration Id. + /// + /// + /// The parameters supplied to the create compilation job operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string compilationJobName, DscCompilationJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc compilation jobs. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobStreamOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobStreamOperations.cs new file mode 100644 index 000000000000..072c00eff8a8 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/IDscCompilationJobStreamOperations.cs @@ -0,0 +1,56 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DscCompilationJobStreamOperations operations. + /// + public partial interface IDscCompilationJobStreamOperations + { + /// + /// Retrieve all the job streams for the compilation Job. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The job id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListByJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/IDscConfigurationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IDscConfigurationOperations.cs index 070366e8600e..d3a88ab7ce59 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IDscConfigurationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IDscConfigurationOperations.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Management.Automation using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -28,6 +27,9 @@ public partial interface IDscConfigurationOperations /// Delete the dsc configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -46,11 +48,14 @@ public partial interface IDscConfigurationOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -72,11 +77,46 @@ public partial interface IDscConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create the configuration identified by configuration name. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The create or update parameters for configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create the configuration identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -101,11 +141,14 @@ public partial interface IDscConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string configurationName, DscConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, DscConfigurationUpdateParameters parameters = default(DscConfigurationUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the configuration script identified by configuration name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -127,11 +170,14 @@ public partial interface IDscConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> GetContentWithHttpMessagesAsync(string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of configurations. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -150,7 +196,7 @@ public partial interface IDscConfigurationOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of configurations. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IDscNodeConfigurationOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IDscNodeConfigurationOperations.cs index 791b7780ec6d..a4a5f4fe6e7b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IDscNodeConfigurationOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IDscNodeConfigurationOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -27,8 +28,11 @@ public partial interface IDscNodeConfigurationOperations /// Delete the Dsc node configurations by node configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -45,13 +49,16 @@ public partial interface IDscNodeConfigurationOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the Dsc node configurations by node configuration. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node configuration name. @@ -71,17 +78,20 @@ public partial interface IDscNodeConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create the node configuration identified by node configuration /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// - /// The create or update parameters for configuration. + /// The Dsc node configuration name. /// /// /// The create or update parameters for configuration. @@ -101,16 +111,52 @@ public partial interface IDscNodeConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc node configurations. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The headers that will be added to request. /// - /// - /// The filter to apply on the operation. + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create the node configuration identified by node configuration + /// name. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The Dsc node configuration name. + /// + /// + /// The create or update parameters for configuration. /// /// /// The headers that will be added to request. @@ -127,7 +173,7 @@ public partial interface IDscNodeConfigurationOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeConfigurationName, DscNodeConfigurationCreateOrUpdateParametersProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc node configurations. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IDscNodeOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IDscNodeOperations.cs index 2e6a6e46581d..58aaad594a0b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IDscNodeOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IDscNodeOperations.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -27,8 +28,11 @@ public partial interface IDscNodeOperations /// Delete the dsc node identified by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// Automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -48,13 +52,16 @@ public partial interface IDscNodeOperations /// /// Thrown when a required parameter is null /// - Task> DeleteWithHttpMessagesAsync(string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the dsc node identified by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The node id. @@ -74,18 +81,21 @@ public partial interface IDscNodeOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the dsc node. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// Parameters supplied to the update dsc node. /// - /// + /// /// Parameters supplied to the update dsc node. /// /// @@ -103,16 +113,19 @@ public partial interface IDscNodeOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string nodeId, DscNodeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, DscNodeUpdateParameters dscNodeUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc nodes. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The headers that will be added to request. @@ -129,7 +142,7 @@ public partial interface IDscNodeOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of dsc nodes. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IFieldsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IFieldsOperations.cs index 85ecc7bda479..06185402b067 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IFieldsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IFieldsOperations.cs @@ -28,6 +28,9 @@ public partial interface IFieldsOperations /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -52,6 +55,6 @@ public partial interface IFieldsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByTypeWithHttpMessagesAsync(string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IHybridRunbookWorkerGroupOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IHybridRunbookWorkerGroupOperations.cs index 86d0d2c60a8e..bf33de368638 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IHybridRunbookWorkerGroupOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IHybridRunbookWorkerGroupOperations.cs @@ -27,6 +27,9 @@ public partial interface IHybridRunbookWorkerGroupOperations /// Delete a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// Automation account name. /// @@ -45,11 +48,14 @@ public partial interface IHybridRunbookWorkerGroupOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface IHybridRunbookWorkerGroupOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update a hybrid runbook worker group. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -100,11 +109,14 @@ public partial interface IHybridRunbookWorkerGroupOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string hybridRunbookWorkerGroupName, HybridRunbookWorkerGroupUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of hybrid runbook worker groups. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -123,7 +135,7 @@ public partial interface IHybridRunbookWorkerGroupOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of hybrid runbook worker groups. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IJobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IJobOperations.cs index 4ddebd120d9a..9af26fbdcc8d 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IJobOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IJobOperations.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Management.Automation using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -25,14 +24,20 @@ namespace Microsoft.Azure.Management.Automation public partial interface IJobOperations { /// - /// Retrieve the job output identified by job id. + /// Retrieve the job output identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The name of the job to be created. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -40,7 +45,7 @@ public partial interface IJobOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,16 +54,22 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> GetOutputWithHttpMessagesAsync(string automationAccountName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetOutputWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve the runbook content of the job identified by job id. + /// Retrieve the runbook content of the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -66,7 +77,7 @@ public partial interface IJobOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -75,16 +86,22 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> GetRunbookContentWithHttpMessagesAsync(string automationAccountName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetRunbookContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Suspend the job identified by jobId. + /// Suspend the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -98,16 +115,22 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task SuspendWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task SuspendWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Stop the job identified by jobId. + /// Stop the job identified by jobName. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -121,16 +144,22 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task StopWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task StopWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve the job identified by job id. + /// Retrieve the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -147,20 +176,26 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create a job of the runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The parameters supplied to the create job operation. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -176,17 +211,23 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, JobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, JobCreateParameters parameters, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of jobs. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -202,16 +243,22 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Resume the job identified by jobId. + /// Resume the job identified by jobName. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. + /// + /// + /// Identifies this specific client request. /// /// /// The headers that will be added to request. @@ -225,7 +272,7 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task ResumeWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ResumeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of jobs. /// @@ -233,6 +280,9 @@ public partial interface IJobOperations /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -248,6 +298,6 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IJobScheduleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IJobScheduleOperations.cs index 321f2439fb15..79430a9b149c 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IJobScheduleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IJobScheduleOperations.cs @@ -27,6 +27,9 @@ public partial interface IJobScheduleOperations /// Delete the job schedule identified by job schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the job schedule identified by job schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create a job schedule. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -100,11 +109,14 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of job schedules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -123,7 +135,7 @@ public partial interface IJobScheduleOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of job schedules. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IJobStreamOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IJobStreamOperations.cs index 0c025a2af05e..11c359175a28 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IJobStreamOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IJobStreamOperations.cs @@ -27,15 +27,21 @@ public partial interface IJobStreamOperations /// Retrieve the job stream identified by job stream id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The job stream id. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -51,20 +57,26 @@ public partial interface IJobStreamOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string jobStreamId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job Id. + /// + /// The job name. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -80,14 +92,17 @@ public partial interface IJobStreamOperations /// /// Thrown when a required parameter is null /// - Task>> ListByJobWithHttpMessagesAsync(string automationAccountName, string jobId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string filter = default(string), string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -103,6 +118,6 @@ public partial interface IJobStreamOperations /// /// Thrown when a required parameter is null /// - Task>> ListByJobNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByJobNextWithHttpMessagesAsync(string nextPageLink, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IKeysOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IKeysOperations.cs new file mode 100644 index 000000000000..a1d2439c9e2c --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/IKeysOperations.cs @@ -0,0 +1,52 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// KeysOperations operations. + /// + public partial interface IKeysOperations + { + /// + /// Retrieve the automation keys for an account. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/ILinkedWorkspaceOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ILinkedWorkspaceOperations.cs new file mode 100644 index 000000000000..49182090d9c1 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/ILinkedWorkspaceOperations.cs @@ -0,0 +1,53 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedWorkspaceOperations operations. + /// + public partial interface ILinkedWorkspaceOperations + { + /// + /// Retrieve the linked workspace for the account id. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/IModuleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IModuleOperations.cs index 2b245f8b3e76..063cddce3db4 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IModuleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IModuleOperations.cs @@ -27,6 +27,9 @@ public partial interface IModuleOperations /// Delete the module by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface IModuleOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -71,11 +77,14 @@ public partial interface IModuleOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or Update the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -100,11 +109,14 @@ public partial interface IModuleOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -129,11 +141,14 @@ public partial interface IModuleOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string moduleName, ModuleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, ModuleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of modules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -152,7 +167,7 @@ public partial interface IModuleOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of modules. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/INodeReportsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/INodeReportsOperations.cs index c207b051f144..d06eb3cf6a89 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/INodeReportsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/INodeReportsOperations.cs @@ -12,10 +12,10 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -28,14 +28,17 @@ public partial interface INodeReportsOperations /// Retrieve the Dsc node report list by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The parameters supplied to the list operation. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The headers that will be added to request. @@ -52,13 +55,16 @@ public partial interface INodeReportsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNodeWithHttpMessagesAsync(string automationAccountName, string nodeId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByNodeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the Dsc node report data by node id and report id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -81,13 +87,16 @@ public partial interface INodeReportsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the Dsc node reports by node id and report id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -110,7 +119,7 @@ public partial interface INodeReportsOperations /// /// Thrown when a required parameter is null /// - Task> GetContentWithHttpMessagesAsync(string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the Dsc node report list by node id. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IObjectDataTypesOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IObjectDataTypesOperations.cs index ad9700cd6884..46fbe12a9807 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IObjectDataTypesOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IObjectDataTypesOperations.cs @@ -28,6 +28,9 @@ public partial interface IObjectDataTypesOperations /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -52,12 +55,15 @@ public partial interface IObjectDataTypesOperations /// /// Thrown when a required parameter is null /// - Task>> ListFieldsByModuleAndTypeWithHttpMessagesAsync(string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListFieldsByModuleAndTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of fields of a given type across all accessible /// modules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -79,6 +85,6 @@ public partial interface IObjectDataTypesOperations /// /// Thrown when a required parameter is null /// - Task>> ListFieldsByTypeWithHttpMessagesAsync(string automationAccountName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListFieldsByTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IRunbookDraftOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IRunbookDraftOperations.cs index 5c5257b39e4f..2c20714f4cd1 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IRunbookDraftOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IRunbookDraftOperations.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Management.Automation using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -28,6 +27,9 @@ public partial interface IRunbookDraftOperations /// Retrieve the content of runbook draft identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -40,7 +42,7 @@ public partial interface IRunbookDraftOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,11 +51,14 @@ public partial interface IRunbookDraftOperations /// /// Thrown when a required parameter is null /// - Task> GetContentWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -72,14 +77,20 @@ public partial interface IRunbookDraftOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, Stream runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ReplaceContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the runbook draft identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -101,11 +112,14 @@ public partial interface IRunbookDraftOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Publish runbook draft. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -127,11 +141,15 @@ public partial interface IRunbookDraftOperations /// /// Thrown when a required parameter is null /// - Task> PublishWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PublishWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve the runbook identified by runbook name. + /// Undo draft edit to last known published state identified by runbook + /// name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -153,11 +171,14 @@ public partial interface IRunbookDraftOperations /// /// Thrown when a required parameter is null /// - Task> UndoEditWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UndoEditWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -176,14 +197,20 @@ public partial interface IRunbookDraftOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task BeginCreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, Stream runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginReplaceContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Publish runbook draft. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -205,6 +232,6 @@ public partial interface IRunbookDraftOperations /// /// Thrown when a required parameter is null /// - Task> BeginPublishWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginPublishWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/IRunbookOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IRunbookOperations.cs index a04032d0477e..6d314c9c3401 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IRunbookOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IRunbookOperations.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Management.Automation using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -28,6 +27,9 @@ public partial interface IRunbookOperations /// Retrieve the content of runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -40,7 +42,7 @@ public partial interface IRunbookOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -49,11 +51,14 @@ public partial interface IRunbookOperations /// /// Thrown when a required parameter is null /// - Task> GetContentWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -75,11 +80,14 @@ public partial interface IRunbookOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -99,14 +107,20 @@ public partial interface IRunbookOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -131,11 +145,14 @@ public partial interface IRunbookOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, RunbookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the runbook by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -154,11 +171,14 @@ public partial interface IRunbookOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of runbooks. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -177,7 +197,7 @@ public partial interface IRunbookOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of runbooks. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IScheduleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IScheduleOperations.cs index 0e1e159cb8b6..80cf038ea9bf 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IScheduleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IScheduleOperations.cs @@ -27,6 +27,9 @@ public partial interface IScheduleOperations /// Create a schedule. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -51,11 +54,14 @@ public partial interface IScheduleOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -80,11 +86,14 @@ public partial interface IScheduleOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -106,11 +115,14 @@ public partial interface IScheduleOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -129,11 +141,14 @@ public partial interface IScheduleOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of schedules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -152,7 +167,7 @@ public partial interface IScheduleOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of schedules. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationMachineRunsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationMachineRunsOperations.cs index eabd80f51481..c79a86490f81 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationMachineRunsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationMachineRunsOperations.cs @@ -27,9 +27,18 @@ public partial interface ISoftwareUpdateConfigurationMachineRunsOperations /// Get a single software update configuration machine run by Id. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration machine run. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -45,11 +54,20 @@ public partial interface ISoftwareUpdateConfigurationMachineRunsOperations /// /// Thrown when a required parameter is null /// - Task> GetByIdWithHttpMessagesAsync(System.Guid softwareUpdateConfigurationMachineRunId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByIdWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Return list of software update configuration machine runs /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following /// filters: 'properties/osType', 'properties/status', @@ -77,6 +95,6 @@ public partial interface ISoftwareUpdateConfigurationMachineRunsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationRunsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationRunsOperations.cs index 3028da7a2639..f7414fe6f18a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationRunsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationRunsOperations.cs @@ -27,9 +27,18 @@ public partial interface ISoftwareUpdateConfigurationRunsOperations /// Get a single software update configuration Run by Id. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration run. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -45,11 +54,20 @@ public partial interface ISoftwareUpdateConfigurationRunsOperations /// /// Thrown when a required parameter is null /// - Task> GetByIdWithHttpMessagesAsync(System.Guid softwareUpdateConfigurationRunId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByIdWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationRunId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Return list of software update configuration runs /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following /// filters: 'properties/osType', 'properties/status', @@ -77,6 +95,6 @@ public partial interface ISoftwareUpdateConfigurationRunsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationsOperations.cs index 417c9b14914d..3a6ceb2915bb 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ISoftwareUpdateConfigurationsOperations.cs @@ -28,12 +28,21 @@ public partial interface ISoftwareUpdateConfigurationsOperations /// the URI. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// /// /// Request body. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -49,14 +58,23 @@ public partial interface ISoftwareUpdateConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a single software update configuration by name. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -72,14 +90,23 @@ public partial interface ISoftwareUpdateConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task> GetByNameWithHttpMessagesAsync(string softwareUpdateConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// delete a specific software update configuration. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// The headers that will be added to request. /// @@ -92,11 +119,20 @@ public partial interface ISoftwareUpdateConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string softwareUpdateConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all software update configurations for the account. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. /// @@ -115,6 +151,6 @@ public partial interface ISoftwareUpdateConfigurationsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ISourceControlOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ISourceControlOperations.cs new file mode 100644 index 000000000000..d5b33ca20de4 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/ISourceControlOperations.cs @@ -0,0 +1,199 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SourceControlOperations operations. + /// + public partial interface ISourceControlOperations + { + /// + /// Create a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the create or update source control + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the update source control operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve the source control identified by source control name. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/ISourceControlSyncJobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ISourceControlSyncJobOperations.cs new file mode 100644 index 000000000000..764ddb0f84dd --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/ISourceControlSyncJobOperations.cs @@ -0,0 +1,146 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SourceControlSyncJobOperations operations. + /// + public partial interface ISourceControlSyncJobOperations + { + /// + /// Creates the sync job for a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve the source control sync job identified by job id. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/ITestJobsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ITestJobOperations.cs similarity index 77% rename from src/SDKs/Automation/Management.Automation/Generated/ITestJobsOperations.cs rename to src/SDKs/Automation/Management.Automation/Generated/ITestJobOperations.cs index 00b56126b549..ce060ac92e0b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ITestJobsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ITestJobOperations.cs @@ -19,14 +19,17 @@ namespace Microsoft.Azure.Management.Automation using System.Threading.Tasks; /// - /// TestJobsOperations operations. + /// TestJobOperations operations. /// - public partial interface ITestJobsOperations + public partial interface ITestJobOperations { /// /// Create a test job of the runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -51,11 +54,14 @@ public partial interface ITestJobsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string automationAccountName, string runbookName, TestJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, TestJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the test job for the specified runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -77,11 +83,14 @@ public partial interface ITestJobsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Resume the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -100,11 +109,14 @@ public partial interface ITestJobsOperations /// /// Thrown when a required parameter is null /// - Task ResumeWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ResumeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Stop the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -123,11 +135,14 @@ public partial interface ITestJobsOperations /// /// Thrown when a required parameter is null /// - Task StopWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task StopWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Suspend the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -146,6 +161,6 @@ public partial interface ITestJobsOperations /// /// Thrown when a required parameter is null /// - Task SuspendWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task SuspendWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ITestJobStreamsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ITestJobStreamsOperations.cs index 735705d04224..67af00b253c6 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ITestJobStreamsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ITestJobStreamsOperations.cs @@ -24,10 +24,13 @@ namespace Microsoft.Azure.Management.Automation public partial interface ITestJobStreamsOperations { /// - /// Retrieve a test job streams identified by runbook name and stream - /// id. + /// Retrieve a test job stream of the test job identified by runbook + /// name and stream id. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -52,11 +55,14 @@ public partial interface ITestJobStreamsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of test job streams identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -81,7 +87,7 @@ public partial interface ITestJobStreamsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByTestJobWithHttpMessagesAsync(string automationAccountName, string runbookName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByTestJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of test job streams identified by runbook name. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IVariableOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IVariableOperations.cs index b40338da7ba6..a6f4d0c8b669 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IVariableOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IVariableOperations.cs @@ -27,6 +27,9 @@ public partial interface IVariableOperations /// Create a variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -51,11 +54,14 @@ public partial interface IVariableOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update a variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -80,11 +86,14 @@ public partial interface IVariableOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string variableName, VariableUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, VariableUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -103,11 +112,14 @@ public partial interface IVariableOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the variable identified by variable name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -129,11 +141,14 @@ public partial interface IVariableOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of variables. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -152,7 +167,7 @@ public partial interface IVariableOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of variables. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/IWebhookOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/IWebhookOperations.cs index ed970551979a..9e5346d95b3b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/IWebhookOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/IWebhookOperations.cs @@ -27,6 +27,9 @@ public partial interface IWebhookOperations /// Generates a Uri for use in creating a webhook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -45,11 +48,14 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task> GenerateUriWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GenerateUriWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the webhook by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -68,11 +74,14 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,11 +103,14 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -123,11 +135,14 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -152,11 +167,14 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string automationAccountName, string webhookName, WebhookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, WebhookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of webhooks. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -178,7 +196,7 @@ public partial interface IWebhookOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a list of webhooks. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/JobOperations.cs index 2146331a00b4..f6a9a8324c68 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobOperations.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Automation using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -52,14 +51,20 @@ internal JobOperations(AutomationClient client) public AutomationClient Client { get; private set; } /// - /// Retrieve the job output identified by job id. + /// Retrieve the job output identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The name of the job to be created. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -67,7 +72,7 @@ internal JobOperations(AutomationClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,32 +87,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetOutputWithHttpMessagesAsync(string automationAccountName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetOutputWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (jobId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,19 +128,21 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetOutput", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/output").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -147,6 +162,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -183,7 +206,7 @@ internal JobOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -193,13 +216,14 @@ internal JobOperations(AutomationClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,6 +233,10 @@ internal JobOperations(AutomationClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -221,7 +249,7 @@ internal JobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,7 +259,20 @@ internal JobOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -241,14 +282,20 @@ internal JobOperations(AutomationClient client) } /// - /// Retrieve the runbook content of the job identified by job id. + /// Retrieve the runbook content of the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -256,7 +303,7 @@ internal JobOperations(AutomationClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -271,32 +318,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetRunbookContentWithHttpMessagesAsync(string automationAccountName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetRunbookContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (jobId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -304,19 +359,21 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetRunbookContent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/runbookContent").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -336,6 +393,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -372,7 +437,7 @@ internal JobOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -382,13 +447,14 @@ internal JobOperations(AutomationClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -398,6 +464,10 @@ internal JobOperations(AutomationClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -410,7 +480,7 @@ internal JobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -420,7 +490,20 @@ internal JobOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -430,14 +513,20 @@ internal JobOperations(AutomationClient client) } /// - /// Suspend the job identified by jobId. + /// Suspend the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -457,28 +546,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task SuspendWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SuspendWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (Client.SubscriptionId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -486,19 +587,21 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Suspend", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/suspend").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -518,6 +621,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -607,14 +718,20 @@ internal JobOperations(AutomationClient client) } /// - /// Stop the job identified by jobId. + /// Stop the job identified by jobName. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. + /// + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -634,28 +751,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -663,18 +792,20 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Stop", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/stop").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -695,6 +826,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -784,14 +923,20 @@ internal JobOperations(AutomationClient client) } /// - /// Retrieve the job identified by job id. + /// Retrieve the job identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -814,28 +959,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (Client.SubscriptionId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,19 +1000,21 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -875,6 +1034,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -985,15 +1152,21 @@ internal JobOperations(AutomationClient client) /// Create a job of the runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The parameters supplied to the create job operation. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -1015,23 +1188,39 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, JobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, JobCreateParameters parameters, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -1040,11 +1229,7 @@ internal JobOperations(AutomationClient client) { parameters.Validate(); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1052,20 +1237,22 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1085,6 +1272,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -1201,12 +1396,18 @@ internal JobOperations(AutomationClient client) /// Retrieve a list of jobs. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -1228,17 +1429,25 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -1249,7 +1458,7 @@ internal JobOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1257,16 +1466,18 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("filter", filter); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -1292,6 +1503,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -1366,7 +1585,7 @@ internal JobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1379,7 +1598,7 @@ internal JobOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1399,14 +1618,20 @@ internal JobOperations(AutomationClient client) } /// - /// Resume the job identified by jobId. + /// Resume the job identified by jobName. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// Headers that will be added to request. @@ -1426,28 +1651,40 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResumeWithHttpMessagesAsync(string automationAccountName, System.Guid jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResumeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } + if (jobName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1455,18 +1692,20 @@ internal JobOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Resume", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/resume").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1487,6 +1726,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -1582,6 +1829,9 @@ internal JobOperations(AutomationClient client) /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -1603,7 +1853,7 @@ internal JobOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1617,6 +1867,7 @@ internal JobOperations(AutomationClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccountNext", tracingParameters); } @@ -1638,6 +1889,14 @@ internal JobOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -1712,7 +1971,7 @@ internal JobOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1725,7 +1984,7 @@ internal JobOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/JobOperationsExtensions.cs index 693789967505..1283299bc20d 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobOperationsExtensions.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Management.Automation using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -23,202 +22,264 @@ namespace Microsoft.Azure.Management.Automation public static partial class JobOperationsExtensions { /// - /// Retrieve the job output identified by job id. + /// Retrieve the job output identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The name of the job to be created. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// - public static Stream GetOutput(this IJobOperations operations, string automationAccountName, string jobId) + public static string GetOutput(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - return operations.GetOutputAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + return operations.GetOutputAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Retrieve the job output identified by job id. + /// Retrieve the job output identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The name of the job to be created. + /// + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task GetOutputAsync(this IJobOperations operations, string automationAccountName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetOutputAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetOutputWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetOutputWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Retrieve the runbook content of the job identified by job id. + /// Retrieve the runbook content of the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// - public static Stream GetRunbookContent(this IJobOperations operations, string automationAccountName, string jobId) + /// + /// Identifies this specific client request. + /// + public static string GetRunbookContent(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - return operations.GetRunbookContentAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + return operations.GetRunbookContentAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Retrieve the runbook content of the job identified by job id. + /// Retrieve the runbook content of the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. + /// + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task GetRunbookContentAsync(this IJobOperations operations, string automationAccountName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetRunbookContentAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetRunbookContentWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetRunbookContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Suspend the job identified by jobId. + /// Suspend the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// - public static void Suspend(this IJobOperations operations, string automationAccountName, System.Guid jobId) + /// + /// Identifies this specific client request. + /// + public static void Suspend(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - operations.SuspendAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + operations.SuspendAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Suspend the job identified by jobId. + /// Suspend the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task SuspendAsync(this IJobOperations operations, string automationAccountName, System.Guid jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SuspendAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.SuspendWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.SuspendWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Stop the job identified by jobId. + /// Stop the job identified by jobName. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// - public static void Stop(this IJobOperations operations, string automationAccountName, System.Guid jobId) + public static void Stop(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - operations.StopAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + operations.StopAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Stop the job identified by jobId. + /// Stop the job identified by jobName. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task StopAsync(this IJobOperations operations, string automationAccountName, System.Guid jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task StopAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.StopWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.StopWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Retrieve the job identified by job id. + /// Retrieve the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// - public static Job Get(this IJobOperations operations, string automationAccountName, System.Guid jobId) + /// + /// Identifies this specific client request. + /// + public static Job Get(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - return operations.GetAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Retrieve the job identified by job id. + /// Retrieve the job identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. + /// + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IJobOperations operations, string automationAccountName, System.Guid jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -231,18 +292,24 @@ public static Job Get(this IJobOperations operations, string automationAccountNa /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The parameters supplied to the create job operation. /// - public static Job Create(this IJobOperations operations, string automationAccountName, System.Guid jobId, JobCreateParameters parameters) + /// + /// Identifies this specific client request. + /// + public static Job Create(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, JobCreateParameters parameters, string clientRequestId = default(string)) { - return operations.CreateAsync(automationAccountName, jobId, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, automationAccountName, jobName, parameters, clientRequestId).GetAwaiter().GetResult(); } /// @@ -252,21 +319,27 @@ public static Job Create(this IJobOperations operations, string automationAccoun /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The parameters supplied to the create job operation. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IJobOperations operations, string automationAccountName, System.Guid jobId, JobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, JobCreateParameters parameters, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(automationAccountName, jobId, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, parameters, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -279,15 +352,21 @@ public static Job Create(this IJobOperations operations, string automationAccoun /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The filter to apply on the operation. /// - public static IPage ListByAutomationAccount(this IJobOperations operations, string automationAccountName, string filter = default(string)) + /// + /// Identifies this specific client request. + /// + public static IPage ListByAutomationAccount(this IJobOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string), string clientRequestId = default(string)) { - return operations.ListByAutomationAccountAsync(automationAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, filter, clientRequestId).GetAwaiter().GetResult(); } /// @@ -297,60 +376,78 @@ public static Job Create(this IJobOperations operations, string automationAccoun /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IJobOperations operations, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string), string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, filter, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Resume the job identified by jobId. + /// Resume the job identified by jobName. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// - public static void Resume(this IJobOperations operations, string automationAccountName, System.Guid jobId) + /// + /// Identifies this specific client request. + /// + public static void Resume(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string)) { - operations.ResumeAsync(automationAccountName, jobId).GetAwaiter().GetResult(); + operations.ResumeAsync(resourceGroupName, automationAccountName, jobName, clientRequestId).GetAwaiter().GetResult(); } /// - /// Resume the job identified by jobId. + /// Resume the job identified by jobName. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. + /// + /// + /// The job name. /// - /// - /// The job id. + /// + /// Identifies this specific client request. /// /// /// The cancellation token. /// - public static async Task ResumeAsync(this IJobOperations operations, string automationAccountName, System.Guid jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResumeAsync(this IJobOperations operations, string resourceGroupName, string automationAccountName, string jobName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ResumeWithHttpMessagesAsync(automationAccountName, jobId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, clientRequestId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -363,9 +460,12 @@ public static void Resume(this IJobOperations operations, string automationAccou /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByAutomationAccountNext(this IJobOperations operations, string nextPageLink) + /// + /// Identifies this specific client request. + /// + public static IPage ListByAutomationAccountNext(this IJobOperations operations, string nextPageLink, string clientRequestId = default(string)) { - return operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountNextAsync(nextPageLink, clientRequestId).GetAwaiter().GetResult(); } /// @@ -378,12 +478,15 @@ public static IPage ListByAutomationAccountNext(this IJobOperations operati /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountNextAsync(this IJobOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountNextAsync(this IJobOperations operations, string nextPageLink, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperations.cs index 57415f216da8..ec2c5556f4be 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperations.cs @@ -54,6 +54,9 @@ internal JobScheduleOperations(AutomationClient client) /// Delete the job schedule identified by job schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal JobScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -107,6 +118,7 @@ internal JobScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("jobScheduleId", jobScheduleId); tracingParameters.Add("apiVersion", apiVersion); @@ -116,7 +128,7 @@ internal JobScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobScheduleId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -231,6 +243,9 @@ internal JobScheduleOperations(AutomationClient client) /// Retrieve the job schedule identified by job schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -258,17 +273,25 @@ internal JobScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -287,6 +310,7 @@ internal JobScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("jobScheduleId", jobScheduleId); tracingParameters.Add("apiVersion", apiVersion); @@ -296,7 +320,7 @@ internal JobScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobScheduleId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -429,6 +453,9 @@ internal JobScheduleOperations(AutomationClient client) /// Create a job schedule. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -459,17 +486,25 @@ internal JobScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -496,6 +531,7 @@ internal JobScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("jobScheduleId", jobScheduleId); tracingParameters.Add("parameters", parameters); @@ -506,7 +542,7 @@ internal JobScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{jobScheduleId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobScheduleId, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -645,6 +681,9 @@ internal JobScheduleOperations(AutomationClient client) /// Retrieve a list of job schedules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -669,17 +708,25 @@ internal JobScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -698,6 +745,7 @@ internal JobScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -706,7 +754,7 @@ internal JobScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperationsExtensions.cs index 29a046a72284..4efb446b532b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobScheduleOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class JobScheduleOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The job schedule name. /// - public static void Delete(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId) + public static void Delete(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId) { - operations.DeleteAsync(automationAccountName, jobScheduleId).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, jobScheduleId).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this IJobScheduleOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this IJobScheduleOperations operations, string automat /// /// The cancellation token. /// - public static async Task DeleteAsync(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, jobScheduleId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobScheduleId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this IJobScheduleOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The job schedule name. /// - public static JobSchedule Get(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId) + public static JobSchedule Get(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId) { - return operations.GetAsync(automationAccountName, jobScheduleId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, jobScheduleId).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static JobSchedule Get(this IJobScheduleOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static JobSchedule Get(this IJobScheduleOperations operations, string aut /// /// The cancellation token. /// - public static async Task GetAsync(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, jobScheduleId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobScheduleId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static JobSchedule Get(this IJobScheduleOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static JobSchedule Get(this IJobScheduleOperations operations, string aut /// /// The parameters supplied to the create job schedule operation. /// - public static JobSchedule Create(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters) + public static JobSchedule Create(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters) { - return operations.CreateAsync(automationAccountName, jobScheduleId, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, automationAccountName, jobScheduleId, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static JobSchedule Create(this IJobScheduleOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static JobSchedule Create(this IJobScheduleOperations operations, string /// /// The cancellation token. /// - public static async Task CreateAsync(this IJobScheduleOperations operations, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, System.Guid jobScheduleId, JobScheduleCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(automationAccountName, jobScheduleId, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobScheduleId, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,12 +175,15 @@ public static JobSchedule Create(this IJobScheduleOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IJobScheduleOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -172,15 +193,18 @@ public static IPage ListByAutomationAccount(this IJobScheduleOperat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IJobScheduleOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IJobScheduleOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperations.cs index f360adeac598..73d36990f4a5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperations.cs @@ -54,15 +54,21 @@ internal JobStreamOperations(AutomationClient client) /// Retrieve the job stream identified by job stream id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The job stream id. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -84,36 +90,44 @@ internal JobStreamOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string jobId, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string jobStreamId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (jobId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } if (jobStreamId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "jobStreamId"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -121,21 +135,23 @@ internal JobStreamOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("jobStreamId", jobStreamId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams/{jobStreamId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{jobStreamId}", System.Uri.EscapeDataString(jobStreamId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -155,6 +171,14 @@ internal JobStreamOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -262,18 +286,24 @@ internal JobStreamOperations(AutomationClient client) } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job Id. + /// + /// The job name. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -295,32 +325,40 @@ internal JobStreamOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByJobWithHttpMessagesAsync(string automationAccountName, string jobId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string jobName, string filter = default(string), string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (jobId == null) + if (jobName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2017-05-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -328,19 +366,21 @@ internal JobStreamOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("jobName", jobName); tracingParameters.Add("filter", filter); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByJob", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (filter != null) @@ -365,6 +405,14 @@ internal JobStreamOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) @@ -472,12 +520,15 @@ internal JobStreamOperations(AutomationClient client) } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -499,7 +550,7 @@ internal JobStreamOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByJobNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByJobNextWithHttpMessagesAsync(string nextPageLink, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -513,6 +564,7 @@ internal JobStreamOperations(AutomationClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByJobNext", tracingParameters); } @@ -534,6 +586,14 @@ internal JobStreamOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } + if (clientRequestId != null) + { + if (_httpRequest.Headers.Contains("clientRequestId")) + { + _httpRequest.Headers.Remove("clientRequestId"); + } + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); + } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) diff --git a/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperationsExtensions.cs index d522883f6492..c8ac4a2b618d 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/JobStreamOperationsExtensions.cs @@ -28,18 +28,24 @@ public static partial class JobStreamOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The job stream id. /// - public static JobStream Get(this IJobStreamOperations operations, string automationAccountName, string jobId, string jobStreamId) + /// + /// Identifies this specific client request. + /// + public static JobStream Get(this IJobStreamOperations operations, string resourceGroupName, string automationAccountName, string jobName, string jobStreamId, string clientRequestId = default(string)) { - return operations.GetAsync(automationAccountName, jobId, jobStreamId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, jobName, jobStreamId, clientRequestId).GetAwaiter().GetResult(); } /// @@ -49,76 +55,94 @@ public static JobStream Get(this IJobStreamOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job id. + /// + /// The job name. /// /// /// The job stream id. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IJobStreamOperations operations, string automationAccountName, string jobId, string jobStreamId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IJobStreamOperations operations, string resourceGroupName, string automationAccountName, string jobName, string jobStreamId, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, jobId, jobStreamId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, jobStreamId, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job Id. + /// + /// The job name. /// /// /// The filter to apply on the operation. /// - public static IPage ListByJob(this IJobStreamOperations operations, string automationAccountName, string jobId, string filter = default(string)) + /// + /// Identifies this specific client request. + /// + public static IPage ListByJob(this IJobStreamOperations operations, string resourceGroupName, string automationAccountName, string jobName, string filter = default(string), string clientRequestId = default(string)) { - return operations.ListByJobAsync(automationAccountName, jobId, filter).GetAwaiter().GetResult(); + return operations.ListByJobAsync(resourceGroupName, automationAccountName, jobName, filter, clientRequestId).GetAwaiter().GetResult(); } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// - /// - /// The job Id. + /// + /// The job name. /// /// /// The filter to apply on the operation. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task> ListByJobAsync(this IJobStreamOperations operations, string automationAccountName, string jobId, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByJobAsync(this IJobStreamOperations operations, string resourceGroupName, string automationAccountName, string jobName, string filter = default(string), string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByJobWithHttpMessagesAsync(automationAccountName, jobId, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByJobWithHttpMessagesAsync(resourceGroupName, automationAccountName, jobName, filter, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// @@ -127,13 +151,16 @@ public static JobStream Get(this IJobStreamOperations operations, string automat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByJobNext(this IJobStreamOperations operations, string nextPageLink) + /// + /// Identifies this specific client request. + /// + public static IPage ListByJobNext(this IJobStreamOperations operations, string nextPageLink, string clientRequestId = default(string)) { - return operations.ListByJobNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByJobNextAsync(nextPageLink, clientRequestId).GetAwaiter().GetResult(); } /// - /// Retrieve a list of jobs streams identified by job id. + /// Retrieve a list of jobs streams identified by job name. /// /// /// @@ -142,12 +169,15 @@ public static IPage ListByJobNext(this IJobStreamOperations operation /// /// The NextLink from the previous successful call to List operation. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task> ListByJobNextAsync(this IJobStreamOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByJobNextAsync(this IJobStreamOperations operations, string nextPageLink, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByJobNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByJobNextWithHttpMessagesAsync(nextPageLink, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/KeysOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/KeysOperations.cs new file mode 100644 index 000000000000..56c6e059a423 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/KeysOperations.cs @@ -0,0 +1,258 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// KeysOperations operations. + /// + internal partial class KeysOperations : IServiceOperations, IKeysOperations + { + /// + /// Initializes a new instance of the KeysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal KeysOperations(AutomationClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AutomationClient + /// + public AutomationClient Client { get; private set; } + + /// + /// Retrieve the automation keys for an account. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-10-31"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/KeysOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/KeysOperationsExtensions.cs new file mode 100644 index 000000000000..c4d1a1998a2c --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/KeysOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for KeysOperations. + /// + public static partial class KeysOperationsExtensions + { + /// + /// Retrieve the automation keys for an account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + public static IEnumerable ListByAutomationAccount(this IKeysOperations operations, string resourceGroupName, string automationAccountName) + { + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieve the automation keys for an account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountAsync(this IKeysOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperations.cs new file mode 100644 index 000000000000..960b378c0446 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperations.cs @@ -0,0 +1,259 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedWorkspaceOperations operations. + /// + internal partial class LinkedWorkspaceOperations : IServiceOperations, ILinkedWorkspaceOperations + { + /// + /// Initializes a new instance of the LinkedWorkspaceOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LinkedWorkspaceOperations(AutomationClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AutomationClient + /// + public AutomationClient Client { get; private set; } + + /// + /// Retrieve the linked workspace for the account id. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-10-31"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperationsExtensions.cs new file mode 100644 index 000000000000..300a71d5a23c --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/LinkedWorkspaceOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for LinkedWorkspaceOperations. + /// + public static partial class LinkedWorkspaceOperationsExtensions + { + /// + /// Retrieve the linked workspace for the account id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + public static LinkedWorkspace Get(this ILinkedWorkspaceOperations operations, string resourceGroupName, string automationAccountName) + { + return operations.GetAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieve the linked workspace for the account id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The automation account name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILinkedWorkspaceOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Activity.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Activity.cs index 6cb2c68bb735..fa6b26b8aa7e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Activity.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Activity.cs @@ -46,7 +46,7 @@ public Activity() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public Activity(string id = default(string), string name = default(string), string definition = default(string), IList parameterSets = default(IList), IList outputTypes = default(IList), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Activity(string id = default(string), string name = default(string), string definition = default(string), IList parameterSets = default(IList), IList outputTypes = default(IList), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) { Id = id; Name = name; @@ -98,13 +98,13 @@ public Activity() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AdvancedScheduleMonthlyOccurrence.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AdvancedScheduleMonthlyOccurrence.cs index 9fbfaf9e7c47..828dd8e4870e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/AdvancedScheduleMonthlyOccurrence.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AdvancedScheduleMonthlyOccurrence.cs @@ -34,7 +34,7 @@ public AdvancedScheduleMonthlyOccurrence() /// Occurrence of the week within the month. /// Must be between 1 and 5 /// Day of the occurrence. Must be one of monday, - /// tuesday, wednesday,thursday, friday, saturday, sunday. Possible + /// tuesday, wednesday, thursday, friday, saturday, sunday. Possible /// values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', /// 'Friday', 'Saturday', 'Sunday' public AdvancedScheduleMonthlyOccurrence(int? occurrence = default(int?), string day = default(string)) @@ -58,7 +58,7 @@ public AdvancedScheduleMonthlyOccurrence() /// /// Gets or sets day of the occurrence. Must be one of monday, tuesday, - /// wednesday,thursday, friday, saturday, sunday. Possible values + /// wednesday, thursday, friday, saturday, sunday. Possible values /// include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', /// 'Saturday', 'Sunday' /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationKeyName.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationKeyName.cs index 293248d1883c..f727615efd08 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationKeyName.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationKeyName.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// public static class AgentRegistrationKeyName { - public const string Primary = "Primary"; - public const string Secondary = "Secondary"; + public const string Primary = "primary"; + public const string Secondary = "secondary"; } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationRegenerateKeyParameter.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationRegenerateKeyParameter.cs index 0d5d9e1ca33f..71c00171a5f9 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationRegenerateKeyParameter.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AgentRegistrationRegenerateKeyParameter.cs @@ -35,8 +35,8 @@ public AgentRegistrationRegenerateKeyParameter() /// AgentRegistrationRegenerateKeyParameter class. /// /// Gets or sets the agent registration key name - /// - Primary or Secondary. Possible values include: 'Primary', - /// 'Secondary' + /// - primary or secondary. Possible values include: 'primary', + /// 'secondary' /// Gets or sets the name of the resource. /// Gets or sets the location of the /// resource. @@ -57,8 +57,8 @@ public AgentRegistrationRegenerateKeyParameter() partial void CustomInit(); /// - /// Gets or sets the agent registration key name - Primary or - /// Secondary. Possible values include: 'Primary', 'Secondary' + /// Gets or sets the agent registration key name - primary or + /// secondary. Possible values include: 'primary', 'secondary' /// [JsonProperty(PropertyName = "keyName")] public string KeyName { get; set; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationAccount.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationAccount.cs index 4574d0a8eecb..090d9973742b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationAccount.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationAccount.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the automation account type. /// [Rest.Serialization.JsonTransformation] - public partial class AutomationAccount : Resource + public partial class AutomationAccount : TrackedResource { /// /// Initializes a new instance of the AutomationAccount class. @@ -34,11 +34,13 @@ public AutomationAccount() /// /// Initializes a new instance of the AutomationAccount class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// Resource tags. + /// The Azure Region where the resource + /// lives /// Gets or sets the SKU of account. /// Gets or sets the last modified /// by. @@ -48,8 +50,8 @@ public AutomationAccount() /// Gets the last modified time. /// Gets or sets the description. /// Gets or sets the etag of the resource. - public AutomationAccount(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string lastModifiedBy = default(string), string state = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string), string etag = default(string)) - : base(location, id, name, type, tags) + public AutomationAccount(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), Sku sku = default(Sku), string lastModifiedBy = default(string), string state = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string), string etag = default(string)) + : base(id, name, type, tags, location) { Sku = sku; LastModifiedBy = lastModifiedBy; @@ -89,13 +91,13 @@ public AutomationAccount() /// Gets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets or sets the description. @@ -115,9 +117,8 @@ public AutomationAccount() /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (Sku != null) { Sku.Validate(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyName.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyName.cs new file mode 100644 index 000000000000..0f7dd68c583f --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyName.cs @@ -0,0 +1,22 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + + /// + /// Defines values for AutomationKeyName. + /// + public static class AutomationKeyName + { + public const string Primary = "primary"; + public const string Secondary = "secondary"; + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyPermissions.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyPermissions.cs new file mode 100644 index 000000000000..58dfba0e5b76 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/AutomationKeyPermissions.cs @@ -0,0 +1,21 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + + /// + /// Defines values for AutomationKeyPermissions. + /// + public static class AutomationKeyPermissions + { + public const string Full = "Full"; + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Certificate.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Certificate.cs index da0dd5545521..c3e21462cebd 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Certificate.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Certificate.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the certificate. /// [Rest.Serialization.JsonTransformation] - public partial class Certificate + public partial class Certificate : ProxyResource { /// /// Initializes a new instance of the Certificate class. @@ -32,8 +32,10 @@ public Certificate() /// /// Initializes a new instance of the Certificate class. /// - /// Gets the id of the resource. - /// Gets the name of the certificate. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets the thumbprint of the /// certificate. /// Gets the expiry time of the @@ -43,10 +45,9 @@ public Certificate() /// Gets the creation time. /// Gets the last modified time. /// Gets or sets the description. - public Certificate(string id = default(string), string name = default(string), string thumbprint = default(string), System.DateTime? expiryTime = default(System.DateTime?), bool? isExportable = default(bool?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Certificate(string id = default(string), string name = default(string), string type = default(string), string thumbprint = default(string), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), bool? isExportable = default(bool?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) + : base(id, name, type) { - Id = id; - Name = name; Thumbprint = thumbprint; ExpiryTime = expiryTime; IsExportable = isExportable; @@ -61,18 +62,6 @@ public Certificate() /// partial void CustomInit(); - /// - /// Gets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the name of the certificate. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets the thumbprint of the certificate. /// @@ -83,7 +72,7 @@ public Certificate() /// Gets the expiry time of the certificate. /// [JsonProperty(PropertyName = "properties.expiryTime")] - public System.DateTime? ExpiryTime { get; private set; } + public System.DateTimeOffset ExpiryTime { get; private set; } /// /// Gets the is exportable flag of the certificate. @@ -95,13 +84,13 @@ public Certificate() /// Gets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/CertificateUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/CertificateUpdateParameters.cs index d5853bd80061..e3c80b665caf 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/CertificateUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/CertificateUpdateParameters.cs @@ -38,7 +38,7 @@ public CertificateUpdateParameters() /// certificate. /// Gets or sets the description of the /// certificate. - public CertificateUpdateParameters(string name, string description = default(string)) + public CertificateUpdateParameters(string name = default(string), string description = default(string)) { Name = name; Description = description; @@ -62,18 +62,5 @@ public CertificateUpdateParameters() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Connection.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Connection.cs index 1dc37013753b..9d642ea4b45a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Connection.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Connection.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the connection. /// [Rest.Serialization.JsonTransformation] - public partial class Connection + public partial class Connection : ProxyResource { /// /// Initializes a new instance of the Connection class. @@ -34,8 +34,10 @@ public Connection() /// /// Initializes a new instance of the Connection class. /// - /// Gets the id of the resource. - /// Gets the name of the connection. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the connectionType of the /// connection. /// Gets the field definition @@ -43,10 +45,9 @@ public Connection() /// Gets the creation time. /// Gets the last modified time. /// Gets or sets the description. - public Connection(string id = default(string), string name = default(string), ConnectionTypeAssociationProperty connectionType = default(ConnectionTypeAssociationProperty), IDictionary fieldDefinitionValues = default(IDictionary), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Connection(string id = default(string), string name = default(string), string type = default(string), ConnectionTypeAssociationProperty connectionType = default(ConnectionTypeAssociationProperty), IDictionary fieldDefinitionValues = default(IDictionary), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) + : base(id, name, type) { - Id = id; - Name = name; ConnectionType = connectionType; FieldDefinitionValues = fieldDefinitionValues; CreationTime = creationTime; @@ -60,18 +61,6 @@ public Connection() /// partial void CustomInit(); - /// - /// Gets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the name of the connection. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets or sets the connectionType of the connection. /// @@ -88,13 +77,13 @@ public Connection() /// Gets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ConnectionType.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ConnectionType.cs index baefd63e0d08..654f7a9d59ce 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/ConnectionType.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ConnectionType.cs @@ -36,6 +36,7 @@ public ConnectionType() /// /// Gets the id of the resource. /// Gets the name of the connection type. + /// Resource type /// Gets or sets a Boolean value to indicate if /// the connection type is global. /// Gets the field definitions of the @@ -44,10 +45,11 @@ public ConnectionType() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public ConnectionType(string id = default(string), string name = default(string), bool? isGlobal = default(bool?), IDictionary fieldDefinitions = default(IDictionary), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public ConnectionType(string id = default(string), string name = default(string), string type = default(string), bool? isGlobal = default(bool?), IDictionary fieldDefinitions = default(IDictionary), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) { Id = id; Name = name; + Type = type; IsGlobal = isGlobal; FieldDefinitions = fieldDefinitions; CreationTime = creationTime; @@ -73,6 +75,12 @@ public ConnectionType() [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + /// /// Gets or sets a Boolean value to indicate if the connection type is /// global. @@ -90,13 +98,13 @@ public ConnectionType() /// Gets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Credential.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Credential.cs index 1a4a4d6d1b6d..e020a0abd991 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Credential.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Credential.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the credential. /// [Rest.Serialization.JsonTransformation] - public partial class Credential + public partial class Credential : ProxyResource { /// /// Initializes a new instance of the Credential class. @@ -32,17 +32,18 @@ public Credential() /// /// Initializes a new instance of the Credential class. /// - /// Gets the id of the resource. - /// Gets the name of the credential. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets the user name of the /// credential. /// Gets the creation time. /// Gets the last modified time. /// Gets or sets the description. - public Credential(string id = default(string), string name = default(string), string userName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Credential(string id = default(string), string name = default(string), string type = default(string), string userName = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) + : base(id, name, type) { - Id = id; - Name = name; UserName = userName; CreationTime = creationTime; LastModifiedTime = lastModifiedTime; @@ -55,18 +56,6 @@ public Credential() /// partial void CustomInit(); - /// - /// Gets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the name of the credential. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - /// /// Gets the user name of the credential. /// @@ -77,13 +66,13 @@ public Credential() /// Gets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/CredentialUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/CredentialUpdateParameters.cs index 919be3759cdc..a0c06f1b50bb 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/CredentialUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/CredentialUpdateParameters.cs @@ -39,7 +39,7 @@ public CredentialUpdateParameters() /// credential. /// Gets or sets the description of the /// credential. - public CredentialUpdateParameters(string name, string userName = default(string), string password = default(string), string description = default(string)) + public CredentialUpdateParameters(string name = default(string), string userName = default(string), string password = default(string), string description = default(string)) { Name = name; UserName = userName; @@ -77,18 +77,5 @@ public CredentialUpdateParameters() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscCompilationJob.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscCompilationJob.cs index b3e9563e0a78..6ecd2a595f0f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscCompilationJob.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscCompilationJob.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the Dsc Compilation job. /// [Rest.Serialization.JsonTransformation] - public partial class DscCompilationJob + public partial class DscCompilationJob : ProxyResource { /// /// Initializes a new instance of the DscCompilationJob class. @@ -34,13 +34,20 @@ public DscCompilationJob() /// /// Initializes a new instance of the DscCompilationJob class. /// - /// Gets the id of the resource. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the configuration. /// Gets the compilation job started /// by. /// Gets the id of the job. /// Gets the creation time of the /// job. + /// The current provisioning state of + /// the job. + /// Gets or sets the runOn which specifies the + /// group name where the job is to be executed. /// Gets or sets the status of the job. Possible /// values include: 'New', 'Activating', 'Running', 'Completed', /// 'Failed', 'Stopped', 'Blocked', 'Suspended', 'Disconnected', @@ -56,13 +63,15 @@ public DscCompilationJob() /// time of the job. /// Gets or sets the parameters of the /// job. - public DscCompilationJob(string id = default(string), DscConfigurationAssociationProperty configuration = default(DscConfigurationAssociationProperty), string startedBy = default(string), System.Guid? jobId = default(System.Guid?), System.DateTime? creationTime = default(System.DateTime?), string status = default(string), string statusDetails = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string exception = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), System.DateTime? lastStatusModifiedTime = default(System.DateTime?), IDictionary parameters = default(IDictionary)) + public DscCompilationJob(string id = default(string), string name = default(string), string type = default(string), DscConfigurationAssociationProperty configuration = default(DscConfigurationAssociationProperty), string startedBy = default(string), System.Guid? jobId = default(System.Guid?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), JobProvisioningStateProperty provisioningState = default(JobProvisioningStateProperty), string runOn = default(string), string status = default(string), string statusDetails = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string exception = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), System.DateTimeOffset lastStatusModifiedTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary)) + : base(id, name, type) { - Id = id; Configuration = configuration; StartedBy = startedBy; JobId = jobId; CreationTime = creationTime; + ProvisioningState = provisioningState; + RunOn = runOn; Status = status; StatusDetails = statusDetails; StartTime = startTime; @@ -79,12 +88,6 @@ public DscCompilationJob() /// partial void CustomInit(); - /// - /// Gets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - /// /// Gets or sets the configuration. /// @@ -107,7 +110,20 @@ public DscCompilationJob() /// Gets the creation time of the job. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } + + /// + /// Gets or sets the current provisioning state of the job. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public JobProvisioningStateProperty ProvisioningState { get; set; } + + /// + /// Gets or sets the runOn which specifies the group name where the job + /// is to be executed. + /// + [JsonProperty(PropertyName = "properties.runOn")] + public string RunOn { get; set; } /// /// Gets or sets the status of the job. Possible values include: 'New', @@ -128,13 +144,13 @@ public DscCompilationJob() /// Gets the start time of the job. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; private set; } + public System.DateTimeOffset StartTime { get; private set; } /// /// Gets the end time of the job. /// [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; private set; } + public System.DateTimeOffset EndTime { get; private set; } /// /// Gets the exception of the job. @@ -146,13 +162,13 @@ public DscCompilationJob() /// Gets the last modified time of the job. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets the last status modified time of the job. /// [JsonProperty(PropertyName = "properties.lastStatusModifiedTime")] - public System.DateTime? LastStatusModifiedTime { get; private set; } + public System.DateTimeOffset LastStatusModifiedTime { get; private set; } /// /// Gets or sets the parameters of the job. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfiguration.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfiguration.cs index 2a479f89b37d..9aa640594924 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfiguration.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfiguration.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the configuration type. /// [Rest.Serialization.JsonTransformation] - public partial class DscConfiguration : Resource + public partial class DscConfiguration : TrackedResource { /// /// Initializes a new instance of the DscConfiguration class. @@ -34,11 +34,13 @@ public DscConfiguration() /// /// Initializes a new instance of the DscConfiguration class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// Resource tags. + /// The Azure Region where the resource + /// lives /// Gets or sets the provisioning state /// of the configuration. Possible values include: 'Succeeded' /// Gets or sets the job count of the @@ -54,8 +56,8 @@ public DscConfiguration() /// time. /// Gets or sets the description. /// Gets or sets the etag of the resource. - public DscConfiguration(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), DscConfigurationProvisioningState? provisioningState = default(DscConfigurationProvisioningState?), int? jobCount = default(int?), IDictionary parameters = default(IDictionary), ContentSource source = default(ContentSource), string state = default(string), bool? logVerbose = default(bool?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string), string etag = default(string)) - : base(location, id, name, type, tags) + public DscConfiguration(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), DscConfigurationProvisioningState? provisioningState = default(DscConfigurationProvisioningState?), int? jobCount = default(int?), IDictionary parameters = default(IDictionary), ContentSource source = default(ContentSource), string state = default(string), bool? logVerbose = default(bool?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string), string etag = default(string)) + : base(id, name, type, tags, location) { ProvisioningState = provisioningState; JobCount = jobCount; @@ -117,13 +119,13 @@ public DscConfiguration() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. @@ -143,9 +145,8 @@ public DscConfiguration() /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (Source != null) { Source.Validate(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfigurationUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfigurationUpdateParameters.cs new file mode 100644 index 000000000000..37dc1e3bc60f --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscConfigurationUpdateParameters.cs @@ -0,0 +1,127 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The parameters supplied to the create or update configuration + /// operation. + /// + [Rest.Serialization.JsonTransformation] + public partial class DscConfigurationUpdateParameters + { + /// + /// Initializes a new instance of the DscConfigurationUpdateParameters + /// class. + /// + public DscConfigurationUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DscConfigurationUpdateParameters + /// class. + /// + /// Gets or sets the source. + /// Gets or sets verbose log option. + /// Gets or sets progress log option. + /// Gets or sets the configuration + /// parameters. + /// Gets or sets the description of the + /// configuration. + /// Gets or sets name of the resource. + /// Gets or sets the tags attached to the + /// resource. + public DscConfigurationUpdateParameters(ContentSource source, bool? logVerbose = default(bool?), bool? logProgress = default(bool?), IDictionary parameters = default(IDictionary), string description = default(string), string name = default(string), IDictionary tags = default(IDictionary)) + { + LogVerbose = logVerbose; + LogProgress = logProgress; + Source = source; + Parameters = parameters; + Description = description; + Name = name; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets verbose log option. + /// + [JsonProperty(PropertyName = "properties.logVerbose")] + public bool? LogVerbose { get; set; } + + /// + /// Gets or sets progress log option. + /// + [JsonProperty(PropertyName = "properties.logProgress")] + public bool? LogProgress { get; set; } + + /// + /// Gets or sets the source. + /// + [JsonProperty(PropertyName = "properties.source")] + public ContentSource Source { get; set; } + + /// + /// Gets or sets the configuration parameters. + /// + [JsonProperty(PropertyName = "properties.parameters")] + public IDictionary Parameters { get; set; } + + /// + /// Gets or sets the description of the configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets name of the resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the tags attached to the resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Source == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + } + if (Source != null) + { + Source.Validate(); + } + } + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNode.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNode.cs index d1682d40b115..7a21387a8936 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNode.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNode.cs @@ -10,15 +10,18 @@ namespace Microsoft.Azure.Management.Automation.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// Definition of the dsc node type. + /// Definition of a DscNode /// - public partial class DscNode : Resource + [Rest.Serialization.JsonTransformation] + public partial class DscNode : ProxyResource { /// /// Initializes a new instance of the DscNode class. @@ -31,11 +34,10 @@ public DscNode() /// /// Initializes a new instance of the DscNode class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the last seen time of the /// node. /// Gets or sets the registration time @@ -43,21 +45,21 @@ public DscNode() /// Gets or sets the ip of the node. /// Gets or sets the account id of the /// node. - /// Gets or sets the configuration of - /// the node. + /// Gets or sets the name of the dsc + /// nodeconfiguration. /// Gets or sets the status of the node. /// Gets or sets the node id. /// Gets or sets the etag of the resource. /// Gets or sets the list of /// extensionHandler properties for a Node. - public DscNode(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.DateTime? lastSeen = default(System.DateTime?), System.DateTime? registrationTime = default(System.DateTime?), string ip = default(string), string accountId = default(string), DscNodeConfigurationAssociationProperty nodeConfiguration = default(DscNodeConfigurationAssociationProperty), string status = default(string), string nodeId = default(string), string etag = default(string), IList extensionHandler = default(IList)) - : base(location, id, name, type, tags) + public DscNode(string id = default(string), string name = default(string), string type = default(string), System.DateTimeOffset lastSeen = default(System.DateTimeOffset), System.DateTimeOffset registrationTime = default(System.DateTimeOffset), string ip = default(string), string accountId = default(string), string dscNodeName = default(string), string status = default(string), string nodeId = default(string), string etag = default(string), IList extensionHandler = default(IList)) + : base(id, name, type) { LastSeen = lastSeen; RegistrationTime = registrationTime; Ip = ip; AccountId = accountId; - NodeConfiguration = nodeConfiguration; + DscNodeName = dscNodeName; Status = status; NodeId = nodeId; Etag = etag; @@ -73,66 +75,56 @@ public DscNode() /// /// Gets or sets the last seen time of the node. /// - [JsonProperty(PropertyName = "lastSeen")] - public System.DateTime? LastSeen { get; set; } + [JsonProperty(PropertyName = "properties.lastSeen")] + public System.DateTimeOffset LastSeen { get; set; } /// /// Gets or sets the registration time of the node. /// - [JsonProperty(PropertyName = "registrationTime")] - public System.DateTime? RegistrationTime { get; set; } + [JsonProperty(PropertyName = "properties.registrationTime")] + public System.DateTimeOffset RegistrationTime { get; set; } /// /// Gets or sets the ip of the node. /// - [JsonProperty(PropertyName = "ip")] + [JsonProperty(PropertyName = "properties.ip")] public string Ip { get; set; } /// /// Gets or sets the account id of the node. /// - [JsonProperty(PropertyName = "accountId")] + [JsonProperty(PropertyName = "properties.accountId")] public string AccountId { get; set; } /// - /// Gets or sets the configuration of the node. + /// Gets or sets the name of the dsc nodeconfiguration. /// - [JsonProperty(PropertyName = "nodeConfiguration")] - public DscNodeConfigurationAssociationProperty NodeConfiguration { get; set; } + [JsonProperty(PropertyName = "properties.nodeConfiguration.name")] + public string DscNodeName { get; set; } /// /// Gets or sets the status of the node. /// - [JsonProperty(PropertyName = "status")] + [JsonProperty(PropertyName = "properties.status")] public string Status { get; set; } /// /// Gets or sets the node id. /// - [JsonProperty(PropertyName = "nodeId")] + [JsonProperty(PropertyName = "properties.nodeId")] public string NodeId { get; set; } /// /// Gets or sets the etag of the resource. /// - [JsonProperty(PropertyName = "etag")] + [JsonProperty(PropertyName = "properties.etag")] public string Etag { get; set; } /// /// Gets or sets the list of extensionHandler properties for a Node. /// - [JsonProperty(PropertyName = "extensionHandler")] + [JsonProperty(PropertyName = "properties.extensionHandler")] public IList ExtensionHandler { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfiguration.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfiguration.cs index d3a9bb207513..0ebb414359ae 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfiguration.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfiguration.cs @@ -10,13 +10,16 @@ namespace Microsoft.Azure.Management.Automation.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// /// Definition of the dsc node configuration. /// - public partial class DscNodeConfiguration + [Rest.Serialization.JsonTransformation] + public partial class DscNodeConfiguration : ProxyResource { /// /// Initializes a new instance of the DscNodeConfiguration class. @@ -29,21 +32,29 @@ public DscNodeConfiguration() /// /// Initializes a new instance of the DscNodeConfiguration class. /// - /// Gets or sets the node configuration - /// name. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the last modified /// time. /// Gets or sets creation time. /// Gets or sets the configuration of the /// node. - /// Gets or sets the id of the resource. - public DscNodeConfiguration(string name = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), DscConfigurationAssociationProperty configuration = default(DscConfigurationAssociationProperty), string id = default(string)) + /// Source of node configuration. + /// Number of nodes with this nodeconfiguration + /// assigned + /// If a new build + /// version of NodeConfiguration is required. + public DscNodeConfiguration(string id = default(string), string name = default(string), string type = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), System.DateTimeOffset creationTime = default(System.DateTimeOffset), DscConfigurationAssociationProperty configuration = default(DscConfigurationAssociationProperty), string source = default(string), long? nodeCount = default(long?), bool? incrementNodeConfigurationBuild = default(bool?)) + : base(id, name, type) { - Name = name; LastModifiedTime = lastModifiedTime; CreationTime = creationTime; Configuration = configuration; - Id = id; + Source = source; + NodeCount = nodeCount; + IncrementNodeConfigurationBuild = incrementNodeConfigurationBuild; CustomInit(); } @@ -52,35 +63,42 @@ public DscNodeConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets the node configuration name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - /// /// Gets or sets the last modified time. /// - [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + [JsonProperty(PropertyName = "properties.lastModifiedTime")] + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets creation time. /// - [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the configuration of the node. /// - [JsonProperty(PropertyName = "configuration")] + [JsonProperty(PropertyName = "properties.configuration")] public DscConfigurationAssociationProperty Configuration { get; set; } /// - /// Gets or sets the id of the resource. + /// Gets or sets source of node configuration. + /// + [JsonProperty(PropertyName = "properties.source")] + public string Source { get; set; } + + /// + /// Gets or sets number of nodes with this nodeconfiguration assigned + /// + [JsonProperty(PropertyName = "properties.nodeCount")] + public long? NodeCount { get; set; } + + /// + /// Gets or sets if a new build version of NodeConfiguration is + /// required. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "properties.incrementNodeConfigurationBuild")] + public bool? IncrementNodeConfigurationBuild { get; set; } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfigurationCreateOrUpdateParametersProperties.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfigurationCreateOrUpdateParametersProperties.cs new file mode 100644 index 000000000000..1cfb2fd9c153 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeConfigurationCreateOrUpdateParametersProperties.cs @@ -0,0 +1,107 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters supplied to the create or update node configuration + /// operation. + /// + public partial class DscNodeConfigurationCreateOrUpdateParametersProperties + { + /// + /// Initializes a new instance of the + /// DscNodeConfigurationCreateOrUpdateParametersProperties class. + /// + public DscNodeConfigurationCreateOrUpdateParametersProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DscNodeConfigurationCreateOrUpdateParametersProperties class. + /// + /// Gets or sets the source. + /// Gets or sets the type of the parameter. + /// Gets or sets the configuration of the + /// node. + /// If a new build + /// version of NodeConfiguration is required. + public DscNodeConfigurationCreateOrUpdateParametersProperties(ContentSource source, string name, DscConfigurationAssociationProperty configuration, bool? incrementNodeConfigurationBuild = default(bool?)) + { + Source = source; + Name = name; + Configuration = configuration; + IncrementNodeConfigurationBuild = incrementNodeConfigurationBuild; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the source. + /// + [JsonProperty(PropertyName = "source")] + public ContentSource Source { get; set; } + + /// + /// Gets or sets the type of the parameter. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the configuration of the node. + /// + [JsonProperty(PropertyName = "configuration")] + public DscConfigurationAssociationProperty Configuration { get; set; } + + /// + /// Gets or sets if a new build version of NodeConfiguration is + /// required. + /// + [JsonProperty(PropertyName = "incrementNodeConfigurationBuild")] + public bool? IncrementNodeConfigurationBuild { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Source == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + } + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Configuration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Configuration"); + } + if (Source != null) + { + Source.Validate(); + } + } + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeReport.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeReport.cs index 2043b50725e1..3065191cde12 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeReport.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeReport.cs @@ -68,7 +68,7 @@ public DscNodeReport() /// in the node report. /// Gets or sets the unparsed errors for the /// node report. - public DscNodeReport(System.DateTime? endTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), System.DateTime? startTime = default(System.DateTime?), string type = default(string), string reportId = default(string), string status = default(string), string refreshMode = default(string), string rebootRequested = default(string), string reportFormatVersion = default(string), string configurationVersion = default(string), string id = default(string), IList errors = default(IList), IList resources = default(IList), DscMetaConfiguration metaConfiguration = default(DscMetaConfiguration), string hostName = default(string), IList iPV4Addresses = default(IList), IList iPV6Addresses = default(IList), int? numberOfResources = default(int?), string rawErrors = default(string)) + public DscNodeReport(System.DateTimeOffset endTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), System.DateTimeOffset startTime = default(System.DateTimeOffset), string type = default(string), string reportId = default(string), string status = default(string), string refreshMode = default(string), string rebootRequested = default(string), string reportFormatVersion = default(string), string configurationVersion = default(string), string id = default(string), IList errors = default(IList), IList resources = default(IList), DscMetaConfiguration metaConfiguration = default(DscMetaConfiguration), string hostName = default(string), IList iPV4Addresses = default(IList), IList iPV6Addresses = default(IList), int? numberOfResources = default(int?), string rawErrors = default(string)) { EndTime = endTime; LastModifiedTime = lastModifiedTime; @@ -101,19 +101,19 @@ public DscNodeReport() /// Gets or sets the end time of the node report. /// [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + public System.DateTimeOffset EndTime { get; set; } /// /// Gets or sets the lastModifiedTime of the node report. /// [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the start time of the node report. /// [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets or sets the type of the node report. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParameters.cs index 58b6295ef96b..a4c709b1c1b5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParameters.cs @@ -32,10 +32,11 @@ public DscNodeUpdateParameters() /// Gets or sets the id of the dsc node. /// Gets or sets the configuration of /// the node. - public DscNodeUpdateParameters(string nodeId = default(string), DscNodeConfigurationAssociationProperty nodeConfiguration = default(DscNodeConfigurationAssociationProperty)) + public DscNodeUpdateParameters(string nodeId = default(string), DscNodeConfigurationAssociationProperty nodeConfiguration = default(DscNodeConfigurationAssociationProperty), DscNodeUpdateParametersProperties properties = default(DscNodeUpdateParametersProperties)) { NodeId = nodeId; NodeConfiguration = nodeConfiguration; + Properties = properties; CustomInit(); } @@ -56,5 +57,10 @@ public DscNodeUpdateParameters() [JsonProperty(PropertyName = "nodeConfiguration")] public DscNodeConfigurationAssociationProperty NodeConfiguration { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties")] + public DscNodeUpdateParametersProperties Properties { get; set; } + } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParametersProperties.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParametersProperties.cs new file mode 100644 index 000000000000..fbac0b981406 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscNodeUpdateParametersProperties.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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class DscNodeUpdateParametersProperties + { + /// + /// Initializes a new instance of the DscNodeUpdateParametersProperties + /// class. + /// + public DscNodeUpdateParametersProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DscNodeUpdateParametersProperties + /// class. + /// + /// Gets or sets the name of the dsc + /// nodeconfiguration. + public DscNodeUpdateParametersProperties(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the dsc nodeconfiguration. + /// + [JsonProperty(PropertyName = "nodeConfiguration.name")] + public string Name { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/DscReportResource.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/DscReportResource.cs index e41ffdb1cfc9..f9deebfb3256 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/DscReportResource.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/DscReportResource.cs @@ -50,7 +50,7 @@ public DscReportResource() /// seconds for the resource. /// Gets or sets the start date of the /// resource. - public DscReportResource(string resourceId = default(string), string sourceInfo = default(string), IList dependsOn = default(IList), string moduleName = default(string), string moduleVersion = default(string), string resourceName = default(string), string error = default(string), string status = default(string), double? durationInSeconds = default(double?), System.DateTime? startDate = default(System.DateTime?)) + public DscReportResource(string resourceId = default(string), string sourceInfo = default(string), IList dependsOn = default(IList), string moduleName = default(string), string moduleVersion = default(string), string resourceName = default(string), string error = default(string), string status = default(string), double? durationInSeconds = default(double?), System.DateTimeOffset startDate = default(System.DateTimeOffset)) { ResourceId = resourceId; SourceInfo = sourceInfo; @@ -129,7 +129,7 @@ public DscReportResource() /// Gets or sets the start date of the resource. /// [JsonProperty(PropertyName = "startDate")] - public System.DateTime? StartDate { get; set; } + public System.DateTimeOffset StartDate { get; set; } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/HybridRunbookWorker.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/HybridRunbookWorker.cs index c50206b53264..80ba1857430f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/HybridRunbookWorker.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/HybridRunbookWorker.cs @@ -34,7 +34,7 @@ public HybridRunbookWorker() /// address. /// Gets or sets the registration time /// of the worker machine. - public HybridRunbookWorker(string name = default(string), string ip = default(string), System.DateTime? registrationTime = default(System.DateTime?)) + public HybridRunbookWorker(string name = default(string), string ip = default(string), System.DateTimeOffset registrationTime = default(System.DateTimeOffset)) { Name = name; Ip = ip; @@ -63,7 +63,7 @@ public HybridRunbookWorker() /// Gets or sets the registration time of the worker machine. /// [JsonProperty(PropertyName = "registrationTime")] - public System.DateTime? RegistrationTime { get; set; } + public System.DateTimeOffset RegistrationTime { get; set; } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Job.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Job.cs index eb9d99d82fed..bffd69a42e68 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Job.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Job.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the job. /// [Rest.Serialization.JsonTransformation] - public partial class Job + public partial class Job : ProxyResource { /// /// Initializes a new instance of the Job class. @@ -34,7 +34,10 @@ public Job() /// /// Initializes a new instance of the Job class. /// - /// Gets or sets the id of the resource. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the runbook. /// Gets or sets the job started by. /// Gets or sets the runOn which specifies the @@ -59,9 +62,11 @@ public Job() /// modified time of the job. /// Gets or sets the parameters of the /// job. - public Job(string id = default(string), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string startedBy = default(string), string runOn = default(string), System.Guid? jobId = default(System.Guid?), System.DateTime? creationTime = default(System.DateTime?), string status = default(string), string statusDetails = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string exception = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), System.DateTime? lastStatusModifiedTime = default(System.DateTime?), IDictionary parameters = default(IDictionary)) + /// The provisioning state of a + /// resource. + public Job(string id = default(string), string name = default(string), string type = default(string), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string startedBy = default(string), string runOn = default(string), System.Guid? jobId = default(System.Guid?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string status = default(string), string statusDetails = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string exception = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), System.DateTimeOffset lastStatusModifiedTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary), JobProvisioningStateProperty provisioningState = default(JobProvisioningStateProperty)) + : base(id, name, type) { - Id = id; Runbook = runbook; StartedBy = startedBy; RunOn = runOn; @@ -75,6 +80,7 @@ public Job() LastModifiedTime = lastModifiedTime; LastStatusModifiedTime = lastStatusModifiedTime; Parameters = parameters; + ProvisioningState = provisioningState; CustomInit(); } @@ -83,12 +89,6 @@ public Job() /// partial void CustomInit(); - /// - /// Gets or sets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - /// /// Gets or sets the runbook. /// @@ -118,7 +118,7 @@ public Job() /// Gets or sets the creation time of the job. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the status of the job. Possible values include: 'New', @@ -139,13 +139,13 @@ public Job() /// Gets or sets the start time of the job. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets or sets the end time of the job. /// [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; set; } + public System.DateTimeOffset EndTime { get; set; } /// /// Gets or sets the exception of the job. @@ -157,13 +157,13 @@ public Job() /// Gets or sets the last modified time of the job. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the last status modified time of the job. /// [JsonProperty(PropertyName = "properties.lastStatusModifiedTime")] - public System.DateTime? LastStatusModifiedTime { get; set; } + public System.DateTimeOffset LastStatusModifiedTime { get; set; } /// /// Gets or sets the parameters of the job. @@ -171,5 +171,11 @@ public Job() [JsonProperty(PropertyName = "properties.parameters")] public IDictionary Parameters { get; set; } + /// + /// Gets or sets the provisioning state of a resource. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public JobProvisioningStateProperty ProvisioningState { get; set; } + } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobCollectionItem.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobCollectionItem.cs new file mode 100644 index 000000000000..2e19960508a4 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobCollectionItem.cs @@ -0,0 +1,123 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Job collection item properties. + /// + [Rest.Serialization.JsonTransformation] + public partial class JobCollectionItem : ProxyResource + { + /// + /// Initializes a new instance of the JobCollectionItem class. + /// + public JobCollectionItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobCollectionItem class. + /// + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// The runbook association. + /// The id of the job. + /// The creation time of the job. + /// The status of the job. Possible values + /// include: 'New', 'Activating', 'Running', 'Completed', 'Failed', + /// 'Stopped', 'Blocked', 'Suspended', 'Disconnected', 'Suspending', + /// 'Stopping', 'Resuming', 'Removing' + /// The start time of the job. + /// The end time of the job. + /// The last modified time of the + /// job. + /// The current provisioning state of + /// the job. + public JobCollectionItem(string id = default(string), string name = default(string), string type = default(string), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), System.Guid? jobId = default(System.Guid?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string status = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), JobProvisioningStateProperty provisioningState = default(JobProvisioningStateProperty)) + : base(id, name, type) + { + Runbook = runbook; + JobId = jobId; + CreationTime = creationTime; + Status = status; + StartTime = startTime; + EndTime = endTime; + LastModifiedTime = lastModifiedTime; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the runbook association. + /// + [JsonProperty(PropertyName = "properties.runbook")] + public RunbookAssociationProperty Runbook { get; private set; } + + /// + /// Gets the id of the job. + /// + [JsonProperty(PropertyName = "properties.jobId")] + public System.Guid? JobId { get; private set; } + + /// + /// Gets the creation time of the job. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTimeOffset CreationTime { get; private set; } + + /// + /// Gets the status of the job. Possible values include: 'New', + /// 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + /// 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + /// 'Resuming', 'Removing' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the start time of the job. + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTimeOffset StartTime { get; private set; } + + /// + /// Gets the end time of the job. + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTimeOffset EndTime { get; private set; } + + /// + /// Gets the last modified time of the job. + /// + [JsonProperty(PropertyName = "properties.lastModifiedTime")] + public System.DateTimeOffset LastModifiedTime { get; private set; } + + /// + /// Gets or sets the current provisioning state of the job. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public JobProvisioningStateProperty ProvisioningState { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobCreateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobCreateParameters.cs index 77d6a7fc9815..1accfa579680 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/JobCreateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobCreateParameters.cs @@ -39,19 +39,11 @@ public JobCreateParameters() /// job. /// Gets or sets the runOn which specifies the /// group name where the job is to be executed. - /// Gets or sets name of the resource. - /// Gets or sets the location of the - /// resource. - /// Gets or sets the tags attached to the - /// resource. - public JobCreateParameters(RunbookAssociationProperty runbook, IDictionary parameters = default(IDictionary), string runOn = default(string), string name = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + public JobCreateParameters(RunbookAssociationProperty runbook, IDictionary parameters = default(IDictionary), string runOn = default(string)) { Runbook = runbook; Parameters = parameters; RunOn = runOn; - Name = name; - Location = location; - Tags = tags; CustomInit(); } @@ -79,24 +71,6 @@ public JobCreateParameters() [JsonProperty(PropertyName = "properties.runOn")] public string RunOn { get; set; } - /// - /// Gets or sets name of the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the location of the resource. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the tags attached to the resource. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Validate the object. /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobListResult.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobListResult.cs new file mode 100644 index 000000000000..ae86533df211 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobListResult.cs @@ -0,0 +1,61 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The response model for the list job operation. + /// + public partial class JobListResult + { + /// + /// Initializes a new instance of the JobListResult class. + /// + public JobListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobListResult class. + /// + /// Gets or sets a list of jobs. + /// Gets or sets the next link. + public JobListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of jobs. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets the next link. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningState.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningState.cs new file mode 100644 index 000000000000..c98fb5df472b --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningState.cs @@ -0,0 +1,24 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + + /// + /// Defines values for JobProvisioningState. + /// + public static class JobProvisioningState + { + public const string Failed = "Failed"; + public const string Succeeded = "Succeeded"; + public const string Suspended = "Suspended"; + public const string Processing = "Processing"; + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningStateProperty.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningStateProperty.cs new file mode 100644 index 000000000000..4f7e00bd27a9 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobProvisioningStateProperty.cs @@ -0,0 +1,56 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The provisioning state property. + /// + public partial class JobProvisioningStateProperty + { + /// + /// Initializes a new instance of the JobProvisioningStateProperty + /// class. + /// + public JobProvisioningStateProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobProvisioningStateProperty + /// class. + /// + /// The provisioning state of the + /// resource. Possible values include: 'Failed', 'Succeeded', + /// 'Suspended', 'Processing' + public JobProvisioningStateProperty(string provisioningState = default(string)) + { + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobSchedule.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobSchedule.cs index 32778ff71412..b5ec1a44a1ee 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/JobSchedule.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobSchedule.cs @@ -34,7 +34,9 @@ public JobSchedule() /// /// Initializes a new instance of the JobSchedule class. /// - /// Gets or sets the id of the resource. + /// Gets the id of the resource. + /// Gets the name of the variable. + /// Resource type /// Gets or sets the id of job /// schedule. /// Gets or sets the schedule. @@ -43,9 +45,11 @@ public JobSchedule() /// scheduled job should run on. /// Gets or sets the parameters of the job /// schedule. - public JobSchedule(string id = default(string), string jobScheduleId = default(string), ScheduleAssociationProperty schedule = default(ScheduleAssociationProperty), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string), IDictionary parameters = default(IDictionary)) + public JobSchedule(string id = default(string), string name = default(string), string type = default(string), string jobScheduleId = default(string), ScheduleAssociationProperty schedule = default(ScheduleAssociationProperty), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string), IDictionary parameters = default(IDictionary)) { Id = id; + Name = name; + Type = type; JobScheduleId = jobScheduleId; Schedule = schedule; Runbook = runbook; @@ -60,10 +64,22 @@ public JobSchedule() partial void CustomInit(); /// - /// Gets or sets the id of the resource. + /// Gets the id of the resource. /// [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + public string Id { get; private set; } + + /// + /// Gets the name of the variable. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// /// Gets or sets the id of job schedule. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobStream.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobStream.cs index 957bd1ce1843..194a23e35c99 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/JobStream.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobStream.cs @@ -46,7 +46,7 @@ public JobStream() /// Gets or sets the summary. /// Gets or sets the values of the job /// stream. - public JobStream(string id = default(string), string jobStreamId = default(string), System.DateTime? time = default(System.DateTime?), string streamType = default(string), string streamText = default(string), string summary = default(string), IDictionary value = default(IDictionary)) + public JobStream(string id = default(string), string jobStreamId = default(string), System.DateTimeOffset time = default(System.DateTimeOffset), string streamType = default(string), string streamText = default(string), string summary = default(string), IDictionary value = default(IDictionary)) { Id = id; JobStreamId = jobStreamId; @@ -79,7 +79,7 @@ public JobStream() /// Gets or sets the creation time of the job. /// [JsonProperty(PropertyName = "properties.time")] - public System.DateTime? Time { get; set; } + public System.DateTimeOffset Time { get; set; } /// /// Gets or sets the stream type. Possible values include: 'Progress', diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/JobStreamListResult.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/JobStreamListResult.cs new file mode 100644 index 000000000000..fa5d92426981 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/JobStreamListResult.cs @@ -0,0 +1,61 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The response model for the list job stream operation. + /// + public partial class JobStreamListResult + { + /// + /// Initializes a new instance of the JobStreamListResult class. + /// + public JobStreamListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobStreamListResult class. + /// + /// A list of job streams. + /// Gets or sets the next link. + public JobStreamListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of job streams. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets the next link. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Key.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Key.cs new file mode 100644 index 000000000000..169f3a42d0f7 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Key.cs @@ -0,0 +1,72 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Automation key which is used to register a DSC Node + /// + public partial class Key + { + /// + /// Initializes a new instance of the Key class. + /// + public Key() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Key class. + /// + /// Automation key name. Possible values include: + /// 'primary', 'secondary' + /// Automation key permissions. Possible + /// values include: 'Full' + /// Value of the Automation Key used for + /// registration. + public Key(string keyName = default(string), string permissions = default(string), string value = default(string)) + { + KeyName = keyName; + Permissions = permissions; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets automation key name. Possible values include: + /// 'primary', 'secondary' + /// + [JsonProperty(PropertyName = "keyName")] + public string KeyName { get; set; } + + /// + /// Gets or sets automation key permissions. Possible values include: + /// 'Full' + /// + [JsonProperty(PropertyName = "permissions")] + public string Permissions { get; set; } + + /// + /// Gets or sets value of the Automation Key used for registration. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/LinkedWorkspace.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/LinkedWorkspace.cs new file mode 100644 index 000000000000..7922a981cced --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/LinkedWorkspace.cs @@ -0,0 +1,51 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the linked workspace. + /// + public partial class LinkedWorkspace + { + /// + /// Initializes a new instance of the LinkedWorkspace class. + /// + public LinkedWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedWorkspace class. + /// + /// Gets the id of the linked workspace. + public LinkedWorkspace(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the id of the linked workspace. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Module.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Module.cs index af9d8cc5dbb5..820b7e665d7a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Module.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Module.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the module type. /// [Rest.Serialization.JsonTransformation] - public partial class Module : Resource + public partial class Module : TrackedResource { /// /// Initializes a new instance of the Module class. @@ -34,11 +34,13 @@ public Module() /// /// Initializes a new instance of the Module class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// Resource tags. + /// The Azure Region where the resource + /// lives /// Gets or sets the isGlobal flag of the /// module. /// Gets or sets the version of the @@ -63,8 +65,8 @@ public Module() /// time. /// Gets or sets the description. /// Gets or sets the etag of the resource. - public Module(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? isGlobal = default(bool?), string version = default(string), long? sizeInBytes = default(long?), int? activityCount = default(int?), ModuleProvisioningState? provisioningState = default(ModuleProvisioningState?), ContentLink contentLink = default(ContentLink), ModuleErrorInfo error = default(ModuleErrorInfo), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string), string etag = default(string)) - : base(location, id, name, type, tags) + public Module(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), bool? isGlobal = default(bool?), string version = default(string), long? sizeInBytes = default(long?), int? activityCount = default(int?), ModuleProvisioningState? provisioningState = default(ModuleProvisioningState?), ContentLink contentLink = default(ContentLink), ModuleErrorInfo error = default(ModuleErrorInfo), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string), string etag = default(string)) + : base(id, name, type, tags, location) { IsGlobal = isGlobal; Version = version; @@ -137,13 +139,13 @@ public Module() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. @@ -163,9 +165,8 @@ public Module() /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (ContentLink != null) { ContentLink.Validate(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ProvisioningState.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..2d7c6424b4b2 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ProvisioningState.cs @@ -0,0 +1,23 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + + /// + /// Defines values for ProvisioningState. + /// + public static class ProvisioningState + { + public const string Completed = "Completed"; + public const string Failed = "Failed"; + public const string Running = "Running"; + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ProxyResource.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..2bb3c52b5d93 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ProxyResource.cs @@ -0,0 +1,48 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using System.Linq; + + /// + /// The resource model definition for a ARM proxy resource. It will have + /// everything other than required location and tags + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Resource.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Resource.cs index 4de42923b310..b350181f8868 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Resource.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Resource.cs @@ -13,12 +13,10 @@ namespace Microsoft.Azure.Management.Automation.Models using Microsoft.Rest; using Microsoft.Rest.Azure; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The Resource definition. + /// The core properties of ARM resources /// public partial class Resource : IResource { @@ -33,18 +31,15 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; Name = name; Type = type; - Location = location; - Tags = tags; CustomInit(); } @@ -54,47 +49,22 @@ public Resource() partial void CustomInit(); /// - /// Gets resource Id + /// Gets fully qualified resource Id for the resource /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets resource name + /// Gets the name of the resource /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets resource type + /// Gets the type of the resource. /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Runbook.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Runbook.cs index 3a031d60328c..2b3bf4bd075f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Runbook.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Runbook.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the runbook type. /// [Rest.Serialization.JsonTransformation] - public partial class Runbook : Resource + public partial class Runbook : TrackedResource { /// /// Initializes a new instance of the Runbook class. @@ -34,11 +34,13 @@ public Runbook() /// /// Initializes a new instance of the Runbook class. /// - /// Resource location - /// Resource Id - /// Resource name - /// Resource type - /// Resource tags + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// Resource tags. + /// The Azure Region where the resource + /// lives /// Gets or sets the type of the runbook. /// Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', /// 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' @@ -67,8 +69,8 @@ public Runbook() /// time. /// Gets or sets the description. /// Gets or sets the etag of the resource. - public Runbook(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string runbookType = default(string), ContentLink publishContentLink = default(ContentLink), string state = default(string), bool? logVerbose = default(bool?), bool? logProgress = default(bool?), int? logActivityTrace = default(int?), int? jobCount = default(int?), IDictionary parameters = default(IDictionary), IList outputTypes = default(IList), RunbookDraft draft = default(RunbookDraft), RunbookProvisioningState? provisioningState = default(RunbookProvisioningState?), string lastModifiedBy = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string), string etag = default(string)) - : base(location, id, name, type, tags) + public Runbook(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string runbookType = default(string), ContentLink publishContentLink = default(ContentLink), string state = default(string), bool? logVerbose = default(bool?), bool? logProgress = default(bool?), int? logActivityTrace = default(int?), int? jobCount = default(int?), IDictionary parameters = default(IDictionary), IList outputTypes = default(IList), RunbookDraft draft = default(RunbookDraft), RunbookProvisioningState? provisioningState = default(RunbookProvisioningState?), string lastModifiedBy = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string), string etag = default(string)) + : base(id, name, type, tags, location) { RunbookType = runbookType; PublishContentLink = publishContentLink; @@ -174,13 +176,13 @@ public Runbook() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. @@ -200,9 +202,8 @@ public Runbook() /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (PublishContentLink != null) { PublishContentLink.Validate(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraft.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraft.cs index a59140330864..163a9e0e8d2c 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraft.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraft.cs @@ -43,7 +43,7 @@ public RunbookDraft() /// parameters. /// Gets or sets the runbook output /// types. - public RunbookDraft(bool? inEdit = default(bool?), ContentLink draftContentLink = default(ContentLink), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), IDictionary parameters = default(IDictionary), IList outputTypes = default(IList)) + public RunbookDraft(bool? inEdit = default(bool?), ContentLink draftContentLink = default(ContentLink), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary), IList outputTypes = default(IList)) { InEdit = inEdit; DraftContentLink = draftContentLink; @@ -75,13 +75,13 @@ public RunbookDraft() /// Gets or sets the creation time of the runbook draft. /// [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time of the runbook draft. /// [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the runbook draft parameters. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftPublishHeaders.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftPublishHeaders.cs new file mode 100644 index 000000000000..a10c902c4015 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftPublishHeaders.cs @@ -0,0 +1,52 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Publish operation. + /// + public partial class RunbookDraftPublishHeaders + { + /// + /// Initializes a new instance of the RunbookDraftPublishHeaders class. + /// + public RunbookDraftPublishHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RunbookDraftPublishHeaders class. + /// + /// URL to query for status of the + /// operation. + public RunbookDraftPublishHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL to query for status of the operation. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftReplaceContentHeaders.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftReplaceContentHeaders.cs new file mode 100644 index 000000000000..03a5ad0877ae --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/RunbookDraftReplaceContentHeaders.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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ReplaceContent operation. + /// + public partial class RunbookDraftReplaceContentHeaders + { + /// + /// Initializes a new instance of the RunbookDraftReplaceContentHeaders + /// class. + /// + public RunbookDraftReplaceContentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RunbookDraftReplaceContentHeaders + /// class. + /// + /// URL to query for status of the + /// operation. + public RunbookDraftReplaceContentHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URL to query for status of the operation. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Schedule.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Schedule.cs index c979d8c1e646..1332dcb446ff 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Schedule.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Schedule.cs @@ -32,8 +32,9 @@ public Schedule() /// /// Initializes a new instance of the Schedule class. /// - /// Gets or sets the id of the resource. - /// Gets or sets the name of the schedule. + /// Gets the id of the resource. + /// Gets name of the schedule. + /// Resource type /// Gets or sets the start time of the /// schedule. /// Gets the start time's offset @@ -61,10 +62,11 @@ public Schedule() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public Schedule(string id = default(string), string name = default(string), System.DateTime? startTime = default(System.DateTime?), double? startTimeOffsetMinutes = default(double?), System.DateTime? expiryTime = default(System.DateTime?), double? expiryTimeOffsetMinutes = default(double?), bool? isEnabled = default(bool?), System.DateTime? nextRun = default(System.DateTime?), double? nextRunOffsetMinutes = default(double?), object interval = default(object), string frequency = default(string), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Schedule(string id = default(string), string name = default(string), string type = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), double? startTimeOffsetMinutes = default(double?), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), double? expiryTimeOffsetMinutes = default(double?), bool? isEnabled = default(bool?), System.DateTimeOffset nextRun = default(System.DateTimeOffset), double? nextRunOffsetMinutes = default(double?), int? interval = default(int?), string frequency = default(string), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) { Id = id; Name = name; + Type = type; StartTime = startTime; StartTimeOffsetMinutes = startTimeOffsetMinutes; ExpiryTime = expiryTime; @@ -88,22 +90,28 @@ public Schedule() partial void CustomInit(); /// - /// Gets or sets the id of the resource. + /// Gets the id of the resource. /// [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + public string Id { get; private set; } /// - /// Gets or sets the name of the schedule. + /// Gets name of the schedule. /// [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// /// Gets or sets the start time of the schedule. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets the start time's offset in minutes. @@ -115,7 +123,7 @@ public Schedule() /// Gets or sets the end time of the schedule. /// [JsonProperty(PropertyName = "properties.expiryTime")] - public System.DateTime? ExpiryTime { get; set; } + public System.DateTimeOffset ExpiryTime { get; set; } /// /// Gets or sets the expiry time's offset in minutes. @@ -133,7 +141,7 @@ public Schedule() /// Gets or sets the next run time of the schedule. /// [JsonProperty(PropertyName = "properties.nextRun")] - public System.DateTime? NextRun { get; set; } + public System.DateTimeOffset NextRun { get; set; } /// /// Gets or sets the next run time's offset in minutes. @@ -145,7 +153,7 @@ public Schedule() /// Gets or sets the interval of the schedule. /// [JsonProperty(PropertyName = "properties.interval")] - public object Interval { get; set; } + public int? Interval { get; set; } /// /// Gets or sets the frequency of the schedule. Possible values @@ -170,13 +178,13 @@ public Schedule() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleCreateOrUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleCreateOrUpdateParameters.cs index 1486c4ff4d4b..02fdaf7598d4 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleCreateOrUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleCreateOrUpdateParameters.cs @@ -49,7 +49,7 @@ public ScheduleCreateOrUpdateParameters() /// schedule. /// Gets or sets the /// AdvancedSchedule. - public ScheduleCreateOrUpdateParameters(string name, System.DateTime startTime, string frequency, string description = default(string), System.DateTime? expiryTime = default(System.DateTime?), object interval = default(object), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule)) + public ScheduleCreateOrUpdateParameters(string name, System.DateTimeOffset startTime, string frequency, string description = default(string), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), object interval = default(object), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule)) { Name = name; Description = description; @@ -83,13 +83,13 @@ public ScheduleCreateOrUpdateParameters() /// Gets or sets the start time of the schedule. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets or sets the end time of the schedule. /// [JsonProperty(PropertyName = "properties.expiryTime")] - public System.DateTime? ExpiryTime { get; set; } + public System.DateTimeOffset ExpiryTime { get; set; } /// /// Gets or sets the interval of the schedule. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleProperties.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleProperties.cs index 5254d906bc1a..c6ae7fa55dd3 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleProperties.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleProperties.cs @@ -56,7 +56,7 @@ public ScheduleProperties() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public ScheduleProperties(System.DateTime? startTime = default(System.DateTime?), double? startTimeOffsetMinutes = default(double?), System.DateTime? expiryTime = default(System.DateTime?), double? expiryTimeOffsetMinutes = default(double?), bool? isEnabled = default(bool?), System.DateTime? nextRun = default(System.DateTime?), double? nextRunOffsetMinutes = default(double?), object interval = default(object), string frequency = default(string), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public ScheduleProperties(System.DateTimeOffset startTime = default(System.DateTimeOffset), double? startTimeOffsetMinutes = default(double?), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), double? expiryTimeOffsetMinutes = default(double?), bool? isEnabled = default(bool?), System.DateTimeOffset nextRun = default(System.DateTimeOffset), double? nextRunOffsetMinutes = default(double?), int? interval = default(int?), string frequency = default(string), string timeZone = default(string), AdvancedSchedule advancedSchedule = default(AdvancedSchedule), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) { StartTime = startTime; StartTimeOffsetMinutes = startTimeOffsetMinutes; @@ -84,7 +84,7 @@ public ScheduleProperties() /// Gets or sets the start time of the schedule. /// [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets the start time's offset in minutes. @@ -96,7 +96,7 @@ public ScheduleProperties() /// Gets or sets the end time of the schedule. /// [JsonProperty(PropertyName = "expiryTime")] - public System.DateTime? ExpiryTime { get; set; } + public System.DateTimeOffset ExpiryTime { get; set; } /// /// Gets or sets the expiry time's offset in minutes. @@ -114,7 +114,7 @@ public ScheduleProperties() /// Gets or sets the next run time of the schedule. /// [JsonProperty(PropertyName = "nextRun")] - public System.DateTime? NextRun { get; set; } + public System.DateTimeOffset NextRun { get; set; } /// /// Gets or sets the next run time's offset in minutes. @@ -126,7 +126,7 @@ public ScheduleProperties() /// Gets or sets the interval of the schedule. /// [JsonProperty(PropertyName = "interval")] - public object Interval { get; set; } + public int? Interval { get; set; } /// /// Gets or sets the frequency of the schedule. Possible values @@ -151,13 +151,13 @@ public ScheduleProperties() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleUpdateParameters.cs index 7847c7809e84..507a68026e84 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/ScheduleUpdateParameters.cs @@ -37,7 +37,7 @@ public ScheduleUpdateParameters() /// schedule. /// Gets or sets a value indicating whether /// this schedule is enabled. - public ScheduleUpdateParameters(string name, string description = default(string), bool? isEnabled = default(bool?)) + public ScheduleUpdateParameters(string name = default(string), string description = default(string), bool? isEnabled = default(bool?)) { Name = name; Description = description; @@ -68,18 +68,5 @@ public ScheduleUpdateParameters() [JsonProperty(PropertyName = "properties.isEnabled")] public bool? IsEnabled { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfiguration.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfiguration.cs index a65e70dcefeb..ebd4f34eb75a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfiguration.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfiguration.cs @@ -53,7 +53,7 @@ public SoftwareUpdateConfiguration() /// which only appears in the response. /// lastModifiedBy property, which only /// appears in the response. - public SoftwareUpdateConfiguration(UpdateConfiguration updateConfiguration, ScheduleProperties scheduleInfo, string name = default(string), string id = default(string), string type = default(string), string provisioningState = default(string), ErrorResponse error = default(ErrorResponse), System.DateTime? creationTime = default(System.DateTime?), string createdBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), string lastModifiedBy = default(string)) + public SoftwareUpdateConfiguration(UpdateConfiguration updateConfiguration, ScheduleProperties scheduleInfo, string name = default(string), string id = default(string), string type = default(string), string provisioningState = default(string), ErrorResponse error = default(ErrorResponse), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string createdBy = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string lastModifiedBy = default(string)) { Name = name; Id = id; @@ -124,7 +124,7 @@ public SoftwareUpdateConfiguration() /// response. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets createdBy property, which only appears in the response. @@ -137,7 +137,7 @@ public SoftwareUpdateConfiguration() /// response. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets lastModifiedBy property, which only appears in the response. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationCollectionItem.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationCollectionItem.cs index 84377bd137fa..b8835e49625b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationCollectionItem.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationCollectionItem.cs @@ -52,7 +52,7 @@ public SoftwareUpdateConfigurationCollectionItem() /// Provisioning state for the software /// update configuration, which only appears in the response. /// ext run time of the update. - public SoftwareUpdateConfigurationCollectionItem(string name = default(string), string id = default(string), CollectionItemUpdateConfiguration updateConfiguration = default(CollectionItemUpdateConfiguration), string frequency = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string provisioningState = default(string), System.DateTime? nextRun = default(System.DateTime?)) + public SoftwareUpdateConfigurationCollectionItem(string name = default(string), string id = default(string), CollectionItemUpdateConfiguration updateConfiguration = default(CollectionItemUpdateConfiguration), string frequency = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string provisioningState = default(string), System.DateTimeOffset nextRun = default(System.DateTimeOffset)) { Name = name; Id = id; @@ -102,21 +102,21 @@ public SoftwareUpdateConfigurationCollectionItem() /// Gets or sets the start time of the update. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets creation time of the software update configuration, which only /// appears in the response. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets last time software update configuration was modified, which /// only appears in the response. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets provisioning state for the software update configuration, @@ -129,7 +129,7 @@ public SoftwareUpdateConfigurationCollectionItem() /// Gets or sets ext run time of the update. /// [JsonProperty(PropertyName = "properties.nextRun")] - public System.DateTime? NextRun { get; set; } + public System.DateTimeOffset NextRun { get; set; } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationMachineRun.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationMachineRun.cs index ace4e0593d12..acf1a40f90b8 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationMachineRun.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationMachineRun.cs @@ -67,7 +67,7 @@ public SoftwareUpdateConfigurationMachineRun() /// which only appears in the response. /// lastModifiedBy property, which only /// appears in the response. - public SoftwareUpdateConfigurationMachineRun(string name = default(string), string id = default(string), string targetComputer = default(string), string targetComputerType = default(string), UpdateConfigurationNavigation softwareUpdateConfiguration = default(UpdateConfigurationNavigation), string status = default(string), string osType = default(string), System.Guid? correlationId = default(System.Guid?), System.Guid? sourceComputerId = default(System.Guid?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string configuredDuration = default(string), JobNavigation job = default(JobNavigation), System.DateTime? creationTime = default(System.DateTime?), string createdBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), string lastModifiedBy = default(string)) + public SoftwareUpdateConfigurationMachineRun(string name = default(string), string id = default(string), string targetComputer = default(string), string targetComputerType = default(string), UpdateConfigurationNavigation softwareUpdateConfiguration = default(UpdateConfigurationNavigation), string status = default(string), string osType = default(string), System.Guid? correlationId = default(System.Guid?), System.Guid? sourceComputerId = default(System.Guid?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string configuredDuration = default(string), JobNavigation job = default(JobNavigation), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string createdBy = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string lastModifiedBy = default(string)) { Name = name; Id = id; @@ -155,13 +155,13 @@ public SoftwareUpdateConfigurationMachineRun() /// Gets start time of the software update configuration machine run. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; private set; } + public System.DateTimeOffset StartTime { get; private set; } /// /// Gets end time of the software update configuration machine run. /// [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; private set; } + public System.DateTimeOffset EndTime { get; private set; } /// /// Gets configured duration for the software update configuration run. @@ -181,7 +181,7 @@ public SoftwareUpdateConfigurationMachineRun() /// response. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets createdBy property, which only appears in the response. @@ -194,7 +194,7 @@ public SoftwareUpdateConfigurationMachineRun() /// response. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets lastModifiedBy property, which only appears in the response. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationRun.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationRun.cs index 3ec8fa67404c..a74fc87380b5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationRun.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SoftwareUpdateConfigurationRun.cs @@ -62,7 +62,7 @@ public SoftwareUpdateConfigurationRun() /// which only appears in the response. /// lastModifiedBy property, which only /// appears in the response. - public SoftwareUpdateConfigurationRun(string name = default(string), string id = default(string), UpdateConfigurationNavigation softwareUpdateConfiguration = default(UpdateConfigurationNavigation), string status = default(string), string configuredDuration = default(string), string osType = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), int? computerCount = default(int?), int? failedCount = default(int?), System.DateTime? creationTime = default(System.DateTime?), string createdBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), string lastModifiedBy = default(string)) + public SoftwareUpdateConfigurationRun(string name = default(string), string id = default(string), UpdateConfigurationNavigation softwareUpdateConfiguration = default(UpdateConfigurationNavigation), string status = default(string), string configuredDuration = default(string), string osType = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), int? computerCount = default(int?), int? failedCount = default(int?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string createdBy = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string lastModifiedBy = default(string)) { Name = name; Id = id; @@ -127,13 +127,13 @@ public SoftwareUpdateConfigurationRun() /// Gets etart time of the software update configuration run. /// [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; private set; } + public System.DateTimeOffset StartTime { get; private set; } /// /// Gets end time of the software update configuration run. /// [JsonProperty(PropertyName = "properties.endTime")] - public System.DateTime? EndTime { get; private set; } + public System.DateTimeOffset EndTime { get; private set; } /// /// Gets number of computers in the software update configuration run. @@ -152,7 +152,7 @@ public SoftwareUpdateConfigurationRun() /// response. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } + public System.DateTimeOffset CreationTime { get; private set; } /// /// Gets createdBy property, which only appears in the response. @@ -165,7 +165,7 @@ public SoftwareUpdateConfigurationRun() /// response. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } + public System.DateTimeOffset LastModifiedTime { get; private set; } /// /// Gets lastModifiedBy property, which only appears in the response. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControl.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControl.cs new file mode 100644 index 000000000000..cf79d77ae5ad --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControl.cs @@ -0,0 +1,154 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the source control. + /// + [Rest.Serialization.JsonTransformation] + public partial class SourceControl : IResource + { + /// + /// Initializes a new instance of the SourceControl class. + /// + public SourceControl() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceControl class. + /// + /// Resource name. + /// Resource Id. + /// Resource type. + /// Gets or sets the repo url of the source + /// control. + /// Gets or sets the repo branch of the source + /// control. Include branch as empty string for VsoTfvc. + /// Gets or sets the folder path of the source + /// control. + /// Gets or sets auto async of the source + /// control. Default is false. + /// Gets or sets the auto publish of the + /// source control. Default is true. + /// The source type. Must be one of VsoGit, + /// VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', + /// 'GitHub' + /// Gets or sets the description. + /// Gets or sets the creation time. + /// Gets or sets the last modified + /// time. + public SourceControl(string name = default(string), string id = default(string), string type = default(string), string repoUrl = default(string), string branch = default(string), string folderPath = default(string), bool? autoSync = default(bool?), bool? publishRunbook = default(bool?), string sourceType = default(string), string description = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset)) + { + Name = name; + Id = id; + Type = type; + RepoUrl = repoUrl; + Branch = branch; + FolderPath = folderPath; + AutoSync = autoSync; + PublishRunbook = publishRunbook; + SourceType = sourceType; + Description = description; + CreationTime = creationTime; + LastModifiedTime = lastModifiedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets the repo url of the source control. + /// + [JsonProperty(PropertyName = "properties.repoUrl")] + public string RepoUrl { get; set; } + + /// + /// Gets or sets the repo branch of the source control. Include branch + /// as empty string for VsoTfvc. + /// + [JsonProperty(PropertyName = "properties.branch")] + public string Branch { get; set; } + + /// + /// Gets or sets the folder path of the source control. + /// + [JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath { get; set; } + + /// + /// Gets or sets auto async of the source control. Default is false. + /// + [JsonProperty(PropertyName = "properties.autoSync")] + public bool? AutoSync { get; set; } + + /// + /// Gets or sets the auto publish of the source control. Default is + /// true. + /// + [JsonProperty(PropertyName = "properties.publishRunbook")] + public bool? PublishRunbook { get; set; } + + /// + /// Gets or sets the source type. Must be one of VsoGit, VsoTfvc, + /// GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + /// + [JsonProperty(PropertyName = "properties.sourceType")] + public string SourceType { get; set; } + + /// + /// Gets or sets the description. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the creation time. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTimeOffset CreationTime { get; set; } + + /// + /// Gets or sets the last modified time. + /// + [JsonProperty(PropertyName = "properties.lastModifiedTime")] + public System.DateTimeOffset LastModifiedTime { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlCreateOrUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlCreateOrUpdateParameters.cs new file mode 100644 index 000000000000..19e48bc8e34e --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlCreateOrUpdateParameters.cs @@ -0,0 +1,172 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters supplied to the create or update source control + /// operation. + /// + [Rest.Serialization.JsonTransformation] + public partial class SourceControlCreateOrUpdateParameters + { + /// + /// Initializes a new instance of the + /// SourceControlCreateOrUpdateParameters class. + /// + public SourceControlCreateOrUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SourceControlCreateOrUpdateParameters class. + /// + /// Gets or sets the repo url of the source + /// control. + /// Gets or sets the repo branch of the source + /// control. Include branch as empty string for VsoTfvc. + /// Gets or sets the folder path of the source + /// control. Path must be relative. + /// Gets or sets auto async of the source + /// control. Default is false. + /// Gets or sets the auto publish of the + /// source control. Default is true. + /// The source type. Must be one of VsoGit, + /// VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', + /// 'VsoTfvc', 'GitHub' + /// Gets or sets the authorization token + /// for the repo of the source control. + /// Gets or sets the user description of the + /// source control. + public SourceControlCreateOrUpdateParameters(string repoUrl = default(string), string branch = default(string), string folderPath = default(string), bool? autoSync = default(bool?), bool? publishRunbook = default(bool?), string sourceType = default(string), string securityToken = default(string), string description = default(string)) + { + RepoUrl = repoUrl; + Branch = branch; + FolderPath = folderPath; + AutoSync = autoSync; + PublishRunbook = publishRunbook; + SourceType = sourceType; + SecurityToken = securityToken; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the repo url of the source control. + /// + [JsonProperty(PropertyName = "properties.repoUrl")] + public string RepoUrl { get; set; } + + /// + /// Gets or sets the repo branch of the source control. Include branch + /// as empty string for VsoTfvc. + /// + [JsonProperty(PropertyName = "properties.branch")] + public string Branch { get; set; } + + /// + /// Gets or sets the folder path of the source control. Path must be + /// relative. + /// + [JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath { get; set; } + + /// + /// Gets or sets auto async of the source control. Default is false. + /// + [JsonProperty(PropertyName = "properties.autoSync")] + public bool? AutoSync { get; set; } + + /// + /// Gets or sets the auto publish of the source control. Default is + /// true. + /// + [JsonProperty(PropertyName = "properties.publishRunbook")] + public bool? PublishRunbook { get; set; } + + /// + /// Gets or sets the source type. Must be one of VsoGit, VsoTfvc, + /// GitHub, case sensitive. Possible values include: 'VsoGit', + /// 'VsoTfvc', 'GitHub' + /// + [JsonProperty(PropertyName = "properties.sourceType")] + public string SourceType { get; set; } + + /// + /// Gets or sets the authorization token for the repo of the source + /// control. + /// + [JsonProperty(PropertyName = "properties.securityToken")] + public string SecurityToken { get; set; } + + /// + /// Gets or sets the user description of the source control. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RepoUrl != null) + { + if (RepoUrl.Length > 2000) + { + throw new ValidationException(ValidationRules.MaxLength, "RepoUrl", 2000); + } + } + if (Branch != null) + { + if (Branch.Length > 255) + { + throw new ValidationException(ValidationRules.MaxLength, "Branch", 255); + } + } + if (FolderPath != null) + { + if (FolderPath.Length > 255) + { + throw new ValidationException(ValidationRules.MaxLength, "FolderPath", 255); + } + } + if (SecurityToken != null) + { + if (SecurityToken.Length > 1024) + { + throw new ValidationException(ValidationRules.MaxLength, "SecurityToken", 1024); + } + } + if (Description != null) + { + if (Description.Length > 512) + { + throw new ValidationException(ValidationRules.MaxLength, "Description", 512); + } + } + } + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJob.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJob.cs new file mode 100644 index 000000000000..67a8554699ee --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJob.cs @@ -0,0 +1,124 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the source control sync job. + /// + [Rest.Serialization.JsonTransformation] + public partial class SourceControlSyncJob + { + /// + /// Initializes a new instance of the SourceControlSyncJob class. + /// + public SourceControlSyncJob() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceControlSyncJob class. + /// + /// Resource name. + /// Resource type. + /// Resource id. + /// Gets the source control sync + /// job id. + /// Gets the creation time of the + /// job. + /// Gets the provisioning state of the + /// job. Possible values include: 'Completed', 'Failed', + /// 'Running' + /// Gets the start time of the job. + /// Gets the end time of the job. + /// Gets the user who started the sync + /// job. + public SourceControlSyncJob(string name = default(string), string type = default(string), string id = default(string), string sourceControlSyncJobId = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string provisioningState = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string startedBy = default(string)) + { + Name = name; + Type = type; + Id = id; + SourceControlSyncJobId = sourceControlSyncJobId; + CreationTime = creationTime; + ProvisioningState = provisioningState; + StartTime = startTime; + EndTime = endTime; + StartedBy = startedBy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets resource id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the source control sync job id. + /// + [JsonProperty(PropertyName = "properties.sourceControlSyncJobId")] + public string SourceControlSyncJobId { get; set; } + + /// + /// Gets the creation time of the job. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTimeOffset CreationTime { get; private set; } + + /// + /// Gets the provisioning state of the job. Possible values include: + /// 'Completed', 'Failed', 'Running' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets the start time of the job. + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTimeOffset StartTime { get; private set; } + + /// + /// Gets the end time of the job. + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTimeOffset EndTime { get; private set; } + + /// + /// Gets the user who started the sync job. + /// + [JsonProperty(PropertyName = "properties.startedBy")] + public string StartedBy { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobById.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobById.cs new file mode 100644 index 000000000000..519c597ecb97 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobById.cs @@ -0,0 +1,117 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the source control sync job. + /// + [Rest.Serialization.JsonTransformation] + public partial class SourceControlSyncJobById + { + /// + /// Initializes a new instance of the SourceControlSyncJobById class. + /// + public SourceControlSyncJobById() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceControlSyncJobById class. + /// + /// Gets the id of the job. + /// Gets the source control sync + /// job id. + /// Gets the creation time of the + /// job. + /// Gets the provisioning state of the + /// job. Possible values include: 'Completed', 'Failed', + /// 'Running' + /// Gets the start time of the job. + /// Gets the end time of the job. + /// Gets the user who started the sync + /// job. + /// Error details of the source control sync + /// job. + public SourceControlSyncJobById(string id = default(string), string sourceControlSyncJobId = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), string provisioningState = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string startedBy = default(string), SourceControlSyncJobByIdErrors errors = default(SourceControlSyncJobByIdErrors)) + { + Id = id; + SourceControlSyncJobId = sourceControlSyncJobId; + CreationTime = creationTime; + ProvisioningState = provisioningState; + StartTime = startTime; + EndTime = endTime; + StartedBy = startedBy; + Errors = errors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the id of the job. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets the source control sync job id. + /// + [JsonProperty(PropertyName = "properties.sourceControlSyncJobId")] + public string SourceControlSyncJobId { get; set; } + + /// + /// Gets the creation time of the job. + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public System.DateTimeOffset CreationTime { get; private set; } + + /// + /// Gets the provisioning state of the job. Possible values include: + /// 'Completed', 'Failed', 'Running' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets the start time of the job. + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTimeOffset StartTime { get; private set; } + + /// + /// Gets the end time of the job. + /// + [JsonProperty(PropertyName = "properties.endTime")] + public System.DateTimeOffset EndTime { get; private set; } + + /// + /// Gets the user who started the sync job. + /// + [JsonProperty(PropertyName = "properties.startedBy")] + public string StartedBy { get; set; } + + /// + /// Gets or sets error details of the source control sync job. + /// + [JsonProperty(PropertyName = "properties.errors")] + public SourceControlSyncJobByIdErrors Errors { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobByIdErrors.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobByIdErrors.cs new file mode 100644 index 000000000000..7a46bb481b63 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlSyncJobByIdErrors.cs @@ -0,0 +1,61 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details of the source control sync job. + /// + public partial class SourceControlSyncJobByIdErrors + { + /// + /// Initializes a new instance of the SourceControlSyncJobByIdErrors + /// class. + /// + public SourceControlSyncJobByIdErrors() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceControlSyncJobByIdErrors + /// class. + /// + /// Gets the error code for the job. + /// Gets the error message for the job. + public SourceControlSyncJobByIdErrors(string code = default(string), string message = default(string)) + { + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code for the job. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets the error message for the job. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlUpdateParameters.cs new file mode 100644 index 000000000000..2bd5dead3bb8 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceControlUpdateParameters.cs @@ -0,0 +1,105 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters supplied to the update source control operation. + /// + [Rest.Serialization.JsonTransformation] + public partial class SourceControlUpdateParameters + { + /// + /// Initializes a new instance of the SourceControlUpdateParameters + /// class. + /// + public SourceControlUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceControlUpdateParameters + /// class. + /// + /// Gets or sets the repo branch of the source + /// control. + /// Gets or sets the folder path of the source + /// control. Path must be relative. + /// Gets or sets auto async of the source + /// control. Default is false. + /// Gets or sets the auto publish of the + /// source control. Default is true. + /// Gets or sets the authorization token + /// for the repo of the source control. + /// Gets or sets the user description of the + /// source control. + public SourceControlUpdateParameters(string branch = default(string), string folderPath = default(string), bool? autoSync = default(bool?), bool? publishRunbook = default(bool?), string securityToken = default(string), string description = default(string)) + { + Branch = branch; + FolderPath = folderPath; + AutoSync = autoSync; + PublishRunbook = publishRunbook; + SecurityToken = securityToken; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the repo branch of the source control. + /// + [JsonProperty(PropertyName = "properties.branch")] + public string Branch { get; set; } + + /// + /// Gets or sets the folder path of the source control. Path must be + /// relative. + /// + [JsonProperty(PropertyName = "properties.folderPath")] + public string FolderPath { get; set; } + + /// + /// Gets or sets auto async of the source control. Default is false. + /// + [JsonProperty(PropertyName = "properties.autoSync")] + public bool? AutoSync { get; set; } + + /// + /// Gets or sets the auto publish of the source control. Default is + /// true. + /// + [JsonProperty(PropertyName = "properties.publishRunbook")] + public bool? PublishRunbook { get; set; } + + /// + /// Gets or sets the authorization token for the repo of the source + /// control. + /// + [JsonProperty(PropertyName = "properties.securityToken")] + public string SecurityToken { get; set; } + + /// + /// Gets or sets the user description of the source control. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/SourceType.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceType.cs new file mode 100644 index 000000000000..2dbf1e77f86e --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/SourceType.cs @@ -0,0 +1,23 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + + /// + /// Defines values for SourceType. + /// + public static class SourceType + { + public const string VsoGit = "VsoGit"; + public const string VsoTfvc = "VsoTfvc"; + public const string GitHub = "GitHub"; + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Statistics.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Statistics.cs index 96158d661f1a..2e6814b532f6 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Statistics.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Statistics.cs @@ -36,7 +36,7 @@ public Statistics() /// statistic. /// Gets the endTime of the statistic. /// Gets the id. - public Statistics(string counterProperty = default(string), long? counterValue = default(long?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string id = default(string)) + public Statistics(string counterProperty = default(string), long? counterValue = default(long?), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string id = default(string)) { CounterProperty = counterProperty; CounterValue = counterValue; @@ -67,13 +67,13 @@ public Statistics() /// Gets the startTime of the statistic. /// [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; private set; } + public System.DateTimeOffset StartTime { get; private set; } /// /// Gets the endTime of the statistic. /// [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; private set; } + public System.DateTimeOffset EndTime { get; private set; } /// /// Gets the id. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/TestJob.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/TestJob.cs index b4d293974e29..6882074dc086 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/TestJob.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/TestJob.cs @@ -51,7 +51,9 @@ public TestJob() /// modified time of the test job. /// Gets or sets the parameters of the test /// job. - public TestJob(System.DateTime? creationTime = default(System.DateTime?), string status = default(string), string statusDetails = default(string), string runOn = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string exception = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), System.DateTime? lastStatusModifiedTime = default(System.DateTime?), IDictionary parameters = default(IDictionary)) + /// The activity-level tracing options + /// of the runbook. + public TestJob(System.DateTimeOffset creationTime = default(System.DateTimeOffset), string status = default(string), string statusDetails = default(string), string runOn = default(string), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), string exception = default(string), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), System.DateTimeOffset lastStatusModifiedTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary), int? logActivityTrace = default(int?)) { CreationTime = creationTime; Status = status; @@ -63,6 +65,7 @@ public TestJob() LastModifiedTime = lastModifiedTime; LastStatusModifiedTime = lastStatusModifiedTime; Parameters = parameters; + LogActivityTrace = logActivityTrace; CustomInit(); } @@ -75,7 +78,7 @@ public TestJob() /// Gets or sets the creation time of the test job. /// [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the status of the test job. @@ -100,13 +103,13 @@ public TestJob() /// Gets or sets the start time of the test job. /// [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + public System.DateTimeOffset StartTime { get; set; } /// /// Gets or sets the end time of the test job. /// [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } + public System.DateTimeOffset EndTime { get; set; } /// /// Gets or sets the exception of the test job. @@ -118,13 +121,13 @@ public TestJob() /// Gets or sets the last modified time of the test job. /// [JsonProperty(PropertyName = "lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the last status modified time of the test job. /// [JsonProperty(PropertyName = "lastStatusModifiedTime")] - public System.DateTime? LastStatusModifiedTime { get; set; } + public System.DateTimeOffset LastStatusModifiedTime { get; set; } /// /// Gets or sets the parameters of the test job. @@ -132,5 +135,11 @@ public TestJob() [JsonProperty(PropertyName = "parameters")] public IDictionary Parameters { get; set; } + /// + /// Gets or sets the activity-level tracing options of the runbook. + /// + [JsonProperty(PropertyName = "logActivityTrace")] + public int? LogActivityTrace { get; set; } + } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/TestJobCreateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/TestJobCreateParameters.cs index 26fff1b34c54..dbed5b1b415b 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/TestJobCreateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/TestJobCreateParameters.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Automation.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -32,14 +31,12 @@ public TestJobCreateParameters() /// /// Initializes a new instance of the TestJobCreateParameters class. /// - /// Gets or sets the runbook name. /// Gets or sets the parameters of the test /// job. /// Gets or sets the runOn which specifies the /// group name where the job is to be executed. - public TestJobCreateParameters(string runbookName, IDictionary parameters = default(IDictionary), string runOn = default(string)) + public TestJobCreateParameters(IDictionary parameters = default(IDictionary), string runOn = default(string)) { - RunbookName = runbookName; Parameters = parameters; RunOn = runOn; CustomInit(); @@ -50,12 +47,6 @@ public TestJobCreateParameters() /// partial void CustomInit(); - /// - /// Gets or sets the runbook name. - /// - [JsonProperty(PropertyName = "runbookName")] - public string RunbookName { get; set; } - /// /// Gets or sets the parameters of the test job. /// @@ -69,18 +60,5 @@ public TestJobCreateParameters() [JsonProperty(PropertyName = "runOn")] public string RunOn { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RunbookName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RunbookName"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/TrackedResource.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..8d94a8a82e4b --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/TrackedResource.cs @@ -0,0 +1,67 @@ +// +// 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 Microsoft.Azure.Management.Automation.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The resource model definition for a ARM tracked top level resource + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. + /// Resource tags. + /// The Azure Region where the resource + /// lives + public TrackedResource(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the Azure Region where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Variable.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Variable.cs index abfbe7081f4f..95e59bebdf77 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Variable.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Variable.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the varible. /// [Rest.Serialization.JsonTransformation] - public partial class Variable + public partial class Variable : ProxyResource { /// /// Initializes a new instance of the Variable class. @@ -32,8 +32,10 @@ public Variable() /// /// Initializes a new instance of the Variable class. /// - /// Gets or sets the id of the resource. - /// Gets or sets the name of the variable. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the value of the variable. /// Gets or sets the encrypted flag of the /// variable. @@ -41,10 +43,9 @@ public Variable() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public Variable(string id = default(string), string name = default(string), string value = default(string), bool? isEncrypted = default(bool?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Variable(string id = default(string), string name = default(string), string type = default(string), string value = default(string), bool? isEncrypted = default(bool?), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) + : base(id, name, type) { - Id = id; - Name = name; Value = value; IsEncrypted = isEncrypted; CreationTime = creationTime; @@ -58,18 +59,6 @@ public Variable() /// partial void CustomInit(); - /// - /// Gets or sets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the name of the variable. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - /// /// Gets or sets the value of the variable. /// @@ -86,13 +75,13 @@ public Variable() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/VariableUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/VariableUpdateParameters.cs index 079d310ed829..44fa0d42549e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/VariableUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/VariableUpdateParameters.cs @@ -36,7 +36,7 @@ public VariableUpdateParameters() /// Gets or sets the value of the variable. /// Gets or sets the description of the /// variable. - public VariableUpdateParameters(string name, string value = default(string), string description = default(string)) + public VariableUpdateParameters(string name = default(string), string value = default(string), string description = default(string)) { Name = name; Value = value; @@ -67,18 +67,5 @@ public VariableUpdateParameters() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/Webhook.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/Webhook.cs index 3f572d843684..8a01ad9f1321 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/Webhook.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/Webhook.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Automation.Models /// Definition of the webhook type. /// [Rest.Serialization.JsonTransformation] - public partial class Webhook + public partial class Webhook : ProxyResource { /// /// Initializes a new instance of the Webhook class. @@ -34,8 +34,10 @@ public Webhook() /// /// Initializes a new instance of the Webhook class. /// - /// Gets or sets the id of the resource. - /// Gets or sets the name of the webhook. + /// Fully qualified resource Id for the + /// resource + /// The name of the resource + /// The type of the resource. /// Gets or sets the value of the enabled flag /// of the webhook. /// Gets or sets the webhook uri. @@ -53,10 +55,9 @@ public Webhook() /// Gets or sets the last modified /// time. /// Gets or sets the description. - public Webhook(string id = default(string), string name = default(string), bool? isEnabled = default(bool?), string uri = default(string), System.DateTime? expiryTime = default(System.DateTime?), System.DateTime? lastInvokedTime = default(System.DateTime?), IDictionary parameters = default(IDictionary), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string description = default(string)) + public Webhook(string id = default(string), string name = default(string), string type = default(string), bool? isEnabled = default(bool?), string uri = default(string), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), System.DateTimeOffset lastInvokedTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string), System.DateTimeOffset creationTime = default(System.DateTimeOffset), System.DateTimeOffset lastModifiedTime = default(System.DateTimeOffset), string description = default(string)) + : base(id, name, type) { - Id = id; - Name = name; IsEnabled = isEnabled; Uri = uri; ExpiryTime = expiryTime; @@ -75,18 +76,6 @@ public Webhook() /// partial void CustomInit(); - /// - /// Gets or sets the id of the resource. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the name of the webhook. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - /// /// Gets or sets the value of the enabled flag of the webhook. /// @@ -103,13 +92,13 @@ public Webhook() /// Gets or sets the expiry time. /// [JsonProperty(PropertyName = "properties.expiryTime")] - public System.DateTime? ExpiryTime { get; set; } + public System.DateTimeOffset ExpiryTime { get; set; } /// /// Gets or sets the last invoked time. /// [JsonProperty(PropertyName = "properties.lastInvokedTime")] - public System.DateTime? LastInvokedTime { get; set; } + public System.DateTimeOffset LastInvokedTime { get; set; } /// /// Gets or sets the parameters of the job that is created when the @@ -135,13 +124,13 @@ public Webhook() /// Gets or sets the creation time. /// [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; set; } + public System.DateTimeOffset CreationTime { get; set; } /// /// Gets or sets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; set; } + public System.DateTimeOffset LastModifiedTime { get; set; } /// /// Gets or sets the description. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookCreateOrUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookCreateOrUpdateParameters.cs index 99d7f6f96517..17fb85003421 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookCreateOrUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookCreateOrUpdateParameters.cs @@ -46,7 +46,7 @@ public WebhookCreateOrUpdateParameters() /// Gets or sets the runbook. /// Gets or sets the name of the hybrid worker /// group the webhook job will run on. - public WebhookCreateOrUpdateParameters(string name, bool? isEnabled = default(bool?), string uri = default(string), System.DateTime? expiryTime = default(System.DateTime?), IDictionary parameters = default(IDictionary), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string)) + public WebhookCreateOrUpdateParameters(string name, bool? isEnabled = default(bool?), string uri = default(string), System.DateTimeOffset expiryTime = default(System.DateTimeOffset), IDictionary parameters = default(IDictionary), RunbookAssociationProperty runbook = default(RunbookAssociationProperty), string runOn = default(string)) { Name = name; IsEnabled = isEnabled; @@ -85,7 +85,7 @@ public WebhookCreateOrUpdateParameters() /// Gets or sets the expiry time. /// [JsonProperty(PropertyName = "properties.expiryTime")] - public System.DateTime? ExpiryTime { get; set; } + public System.DateTimeOffset ExpiryTime { get; set; } /// /// Gets or sets the parameters of the job. diff --git a/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookUpdateParameters.cs b/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookUpdateParameters.cs index 42068bfcc312..ecdb5adfc544 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookUpdateParameters.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/Models/WebhookUpdateParameters.cs @@ -43,7 +43,7 @@ public WebhookUpdateParameters() /// job. /// Gets or sets the description of the /// webhook. - public WebhookUpdateParameters(string name, bool? isEnabled = default(bool?), string runOn = default(string), IDictionary parameters = default(IDictionary), string description = default(string)) + public WebhookUpdateParameters(string name = default(string), bool? isEnabled = default(bool?), string runOn = default(string), IDictionary parameters = default(IDictionary), string description = default(string)) { Name = name; IsEnabled = isEnabled; @@ -89,18 +89,5 @@ public WebhookUpdateParameters() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ModuleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ModuleOperations.cs index 708e49f5c681..e2116ddc89a7 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ModuleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ModuleOperations.cs @@ -54,6 +54,9 @@ internal ModuleOperations(AutomationClient client) /// Delete the module by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal ModuleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -111,6 +122,7 @@ internal ModuleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("apiVersion", apiVersion); @@ -120,7 +132,7 @@ internal ModuleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -235,6 +247,9 @@ internal ModuleOperations(AutomationClient client) /// Retrieve the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -262,17 +277,25 @@ internal ModuleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -295,6 +318,7 @@ internal ModuleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("apiVersion", apiVersion); @@ -304,7 +328,7 @@ internal ModuleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -437,6 +461,9 @@ internal ModuleOperations(AutomationClient client) /// Create or Update the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -467,17 +494,25 @@ internal ModuleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -508,6 +543,7 @@ internal ModuleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("parameters", parameters); @@ -518,7 +554,7 @@ internal ModuleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -675,6 +711,9 @@ internal ModuleOperations(AutomationClient client) /// Update the module identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -705,17 +744,25 @@ internal ModuleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string moduleName, ModuleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, ModuleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -742,6 +789,7 @@ internal ModuleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("parameters", parameters); @@ -752,7 +800,7 @@ internal ModuleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -891,6 +939,9 @@ internal ModuleOperations(AutomationClient client) /// Retrieve a list of modules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -915,17 +966,25 @@ internal ModuleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -944,6 +1003,7 @@ internal ModuleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -952,7 +1012,7 @@ internal ModuleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ModuleOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ModuleOperationsExtensions.cs index 504a4fafb847..975909508504 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ModuleOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ModuleOperationsExtensions.cs @@ -28,15 +28,18 @@ public static partial class ModuleOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The module name. /// - public static void Delete(this IModuleOperations operations, string automationAccountName, string moduleName) + public static void Delete(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName) { - operations.DeleteAsync(automationAccountName, moduleName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, moduleName).GetAwaiter().GetResult(); } /// @@ -46,6 +49,9 @@ public static void Delete(this IModuleOperations operations, string automationAc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -55,9 +61,9 @@ public static void Delete(this IModuleOperations operations, string automationAc /// /// The cancellation token. /// - public static async Task DeleteAsync(this IModuleOperations operations, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -67,15 +73,18 @@ public static void Delete(this IModuleOperations operations, string automationAc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The module name. /// - public static Module Get(this IModuleOperations operations, string automationAccountName, string moduleName) + public static Module Get(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName) { - return operations.GetAsync(automationAccountName, moduleName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, moduleName).GetAwaiter().GetResult(); } /// @@ -85,6 +94,9 @@ public static Module Get(this IModuleOperations operations, string automationAcc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -94,9 +106,9 @@ public static Module Get(this IModuleOperations operations, string automationAcc /// /// The cancellation token. /// - public static async Task GetAsync(this IModuleOperations operations, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,6 +121,9 @@ public static Module Get(this IModuleOperations operations, string automationAcc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -118,9 +133,9 @@ public static Module Get(this IModuleOperations operations, string automationAcc /// /// The create or update parameters for module. /// - public static Module CreateOrUpdate(this IModuleOperations operations, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters) + public static Module CreateOrUpdate(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, moduleName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, moduleName, parameters).GetAwaiter().GetResult(); } /// @@ -130,6 +145,9 @@ public static Module CreateOrUpdate(this IModuleOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +160,9 @@ public static Module CreateOrUpdate(this IModuleOperations operations, string au /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IModuleOperations operations, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, ModuleCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, moduleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,6 +175,9 @@ public static Module CreateOrUpdate(this IModuleOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -166,9 +187,9 @@ public static Module CreateOrUpdate(this IModuleOperations operations, string au /// /// The update parameters for module. /// - public static Module Update(this IModuleOperations operations, string automationAccountName, string moduleName, ModuleUpdateParameters parameters) + public static Module Update(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, ModuleUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, moduleName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, moduleName, parameters).GetAwaiter().GetResult(); } /// @@ -178,6 +199,9 @@ public static Module Update(this IModuleOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -190,9 +214,9 @@ public static Module Update(this IModuleOperations operations, string automation /// /// The cancellation token. /// - public static async Task UpdateAsync(this IModuleOperations operations, string automationAccountName, string moduleName, ModuleUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IModuleOperations operations, string resourceGroupName, string automationAccountName, string moduleName, ModuleUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, moduleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -205,12 +229,15 @@ public static Module Update(this IModuleOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IModuleOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IModuleOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -220,15 +247,18 @@ public static IPage ListByAutomationAccount(this IModuleOperations opera /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IModuleOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IModuleOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperations.cs index e62006b684fc..cb4dfbd1c7e6 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperations.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -55,14 +55,17 @@ internal NodeReportsOperations(AutomationClient client) /// Retrieve the Dsc node report list by node id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The parameters supplied to the list operation. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -85,17 +88,25 @@ internal NodeReportsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNodeWithHttpMessagesAsync(string automationAccountName, string nodeId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByNodeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -110,7 +121,7 @@ internal NodeReportsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -118,9 +129,10 @@ internal NodeReportsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); - tracingParameters.Add("filter", filter); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByNode", tracingParameters); @@ -128,14 +140,18 @@ internal NodeReportsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (filter != null) + if (odataQuery != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } } if (apiVersion != null) { @@ -265,8 +281,11 @@ internal NodeReportsOperations(AutomationClient client) /// Retrieve the Dsc node report data by node id and report id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -295,17 +314,25 @@ internal NodeReportsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -324,7 +351,7 @@ internal NodeReportsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -332,6 +359,7 @@ internal NodeReportsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("reportId", reportId); @@ -342,7 +370,7 @@ internal NodeReportsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{reportId}", System.Uri.EscapeDataString(reportId)); @@ -476,8 +504,11 @@ internal NodeReportsOperations(AutomationClient client) /// Retrieve the Dsc node reports by node id and report id. /// /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -506,17 +537,25 @@ internal NodeReportsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContentWithHttpMessagesAsync(string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string nodeId, string reportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -535,7 +574,7 @@ internal NodeReportsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2015-10-31"; + string apiVersion = "2018-01-15"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -543,6 +582,7 @@ internal NodeReportsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("nodeId", nodeId); tracingParameters.Add("reportId", reportId); @@ -553,7 +593,7 @@ internal NodeReportsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{nodeId}", System.Uri.EscapeDataString(nodeId)); _url = _url.Replace("{reportId}", System.Uri.EscapeDataString(reportId)); @@ -613,7 +653,7 @@ internal NodeReportsOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -651,7 +691,7 @@ internal NodeReportsOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -661,7 +701,20 @@ internal NodeReportsOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperationsExtensions.cs index 30b4bc38da51..3564c2a3460f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/NodeReportsOperationsExtensions.cs @@ -12,8 +12,8 @@ namespace Microsoft.Azure.Management.Automation { using Microsoft.Rest; using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; using Models; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -29,18 +29,21 @@ public static partial class NodeReportsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The parameters supplied to the list operation. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// - public static IPage ListByNode(this INodeReportsOperations operations, string automationAccountName, string nodeId, string filter = default(string)) + public static IPage ListByNode(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, ODataQuery odataQuery = default(ODataQuery)) { - return operations.ListByNodeAsync(automationAccountName, nodeId, filter).GetAwaiter().GetResult(); + return operations.ListByNodeAsync(resourceGroupName, automationAccountName, nodeId, odataQuery).GetAwaiter().GetResult(); } /// @@ -50,21 +53,24 @@ public static partial class NodeReportsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The parameters supplied to the list operation. /// - /// - /// The filter to apply on the operation. + /// + /// OData parameters to apply to the operation. /// /// /// The cancellation token. /// - public static async Task> ListByNodeAsync(this INodeReportsOperations operations, string automationAccountName, string nodeId, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByNodeAsync(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByNodeWithHttpMessagesAsync(automationAccountName, nodeId, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByNodeWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -77,8 +83,11 @@ public static partial class NodeReportsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -86,9 +95,9 @@ public static partial class NodeReportsOperationsExtensions /// /// The report id. /// - public static DscNodeReport Get(this INodeReportsOperations operations, string automationAccountName, string nodeId, string reportId) + public static DscNodeReport Get(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, string reportId) { - return operations.GetAsync(automationAccountName, nodeId, reportId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, nodeId, reportId).GetAwaiter().GetResult(); } /// @@ -98,8 +107,11 @@ public static DscNodeReport Get(this INodeReportsOperations operations, string a /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -110,9 +122,9 @@ public static DscNodeReport Get(this INodeReportsOperations operations, string a /// /// The cancellation token. /// - public static async Task GetAsync(this INodeReportsOperations operations, string automationAccountName, string nodeId, string reportId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, string reportId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, nodeId, reportId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, reportId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -125,8 +137,11 @@ public static DscNodeReport Get(this INodeReportsOperations operations, string a /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -134,9 +149,9 @@ public static DscNodeReport Get(this INodeReportsOperations operations, string a /// /// The report id. /// - public static Stream GetContent(this INodeReportsOperations operations, string automationAccountName, string nodeId, string reportId) + public static object GetContent(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, string reportId) { - return operations.GetContentAsync(automationAccountName, nodeId, reportId).GetAwaiter().GetResult(); + return operations.GetContentAsync(resourceGroupName, automationAccountName, nodeId, reportId).GetAwaiter().GetResult(); } /// @@ -146,8 +161,11 @@ public static Stream GetContent(this INodeReportsOperations operations, string a /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// - /// The automation account name. + /// The name of the automation account. /// /// /// The Dsc node id. @@ -158,11 +176,12 @@ public static Stream GetContent(this INodeReportsOperations operations, string a /// /// The cancellation token. /// - public static async Task GetContentAsync(this INodeReportsOperations operations, string automationAccountName, string nodeId, string reportId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetContentAsync(this INodeReportsOperations operations, string resourceGroupName, string automationAccountName, string nodeId, string reportId, CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetContentWithHttpMessagesAsync(automationAccountName, nodeId, reportId, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, nodeId, reportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// diff --git a/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperations.cs index d32960cdc03c..735efcfb6089 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperations.cs @@ -54,6 +54,9 @@ internal ObjectDataTypesOperations(AutomationClient client) /// Retrieve a list of fields of a given type identified by module name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +87,25 @@ internal ObjectDataTypesOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFieldsByModuleAndTypeWithHttpMessagesAsync(string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFieldsByModuleAndTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string moduleName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -121,6 +132,7 @@ internal ObjectDataTypesOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("moduleName", moduleName); tracingParameters.Add("typeName", typeName); @@ -131,7 +143,7 @@ internal ObjectDataTypesOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{moduleName}", System.Uri.EscapeDataString(moduleName)); _url = _url.Replace("{typeName}", System.Uri.EscapeDataString(typeName)); @@ -265,6 +277,9 @@ internal ObjectDataTypesOperations(AutomationClient client) /// Retrieve a list of fields of a given type across all accessible modules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -292,17 +307,25 @@ internal ObjectDataTypesOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListFieldsByTypeWithHttpMessagesAsync(string automationAccountName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListFieldsByTypeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string typeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -325,6 +348,7 @@ internal ObjectDataTypesOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("typeName", typeName); tracingParameters.Add("apiVersion", apiVersion); @@ -334,7 +358,7 @@ internal ObjectDataTypesOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{typeName}", System.Uri.EscapeDataString(typeName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperationsExtensions.cs index e8a970fbfd04..a177649153c9 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ObjectDataTypesOperationsExtensions.cs @@ -30,6 +30,9 @@ public static partial class ObjectDataTypesOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -39,9 +42,9 @@ public static partial class ObjectDataTypesOperationsExtensions /// /// The name of type. /// - public static IEnumerable ListFieldsByModuleAndType(this IObjectDataTypesOperations operations, string automationAccountName, string moduleName, string typeName) + public static IEnumerable ListFieldsByModuleAndType(this IObjectDataTypesOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string typeName) { - return operations.ListFieldsByModuleAndTypeAsync(automationAccountName, moduleName, typeName).GetAwaiter().GetResult(); + return operations.ListFieldsByModuleAndTypeAsync(resourceGroupName, automationAccountName, moduleName, typeName).GetAwaiter().GetResult(); } /// @@ -51,6 +54,9 @@ public static IEnumerable ListFieldsByModuleAndType(this IObjectDataT /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -63,9 +69,9 @@ public static IEnumerable ListFieldsByModuleAndType(this IObjectDataT /// /// The cancellation token. /// - public static async Task> ListFieldsByModuleAndTypeAsync(this IObjectDataTypesOperations operations, string automationAccountName, string moduleName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListFieldsByModuleAndTypeAsync(this IObjectDataTypesOperations operations, string resourceGroupName, string automationAccountName, string moduleName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListFieldsByModuleAndTypeWithHttpMessagesAsync(automationAccountName, moduleName, typeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListFieldsByModuleAndTypeWithHttpMessagesAsync(resourceGroupName, automationAccountName, moduleName, typeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -78,15 +84,18 @@ public static IEnumerable ListFieldsByModuleAndType(this IObjectDataT /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of type. /// - public static IEnumerable ListFieldsByType(this IObjectDataTypesOperations operations, string automationAccountName, string typeName) + public static IEnumerable ListFieldsByType(this IObjectDataTypesOperations operations, string resourceGroupName, string automationAccountName, string typeName) { - return operations.ListFieldsByTypeAsync(automationAccountName, typeName).GetAwaiter().GetResult(); + return operations.ListFieldsByTypeAsync(resourceGroupName, automationAccountName, typeName).GetAwaiter().GetResult(); } /// @@ -96,6 +105,9 @@ public static IEnumerable ListFieldsByType(this IObjectDataTypesOpera /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -105,9 +117,9 @@ public static IEnumerable ListFieldsByType(this IObjectDataTypesOpera /// /// The cancellation token. /// - public static async Task> ListFieldsByTypeAsync(this IObjectDataTypesOperations operations, string automationAccountName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListFieldsByTypeAsync(this IObjectDataTypesOperations operations, string resourceGroupName, string automationAccountName, string typeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListFieldsByTypeWithHttpMessagesAsync(automationAccountName, typeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListFieldsByTypeWithHttpMessagesAsync(resourceGroupName, automationAccountName, typeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperations.cs index 8ae84782bbde..b36fb82baa4a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperations.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Automation using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -55,6 +54,9 @@ internal RunbookDraftOperations(AutomationClient client) /// Retrieve the content of runbook draft identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -67,7 +69,7 @@ internal RunbookDraftOperations(AutomationClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,17 +84,29 @@ internal RunbookDraftOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContentWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -103,10 +117,6 @@ internal RunbookDraftOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -115,6 +125,7 @@ internal RunbookDraftOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -124,10 +135,10 @@ internal RunbookDraftOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -183,7 +194,7 @@ internal RunbookDraftOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -193,13 +204,14 @@ internal RunbookDraftOperations(AutomationClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,6 +221,10 @@ internal RunbookDraftOperations(AutomationClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -221,7 +237,7 @@ internal RunbookDraftOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,7 +247,20 @@ internal RunbookDraftOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -241,9 +270,12 @@ internal RunbookDraftOperations(AutomationClient client) } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -259,10 +291,10 @@ internal RunbookDraftOperations(AutomationClient client) /// /// The cancellation token. /// - public async Task CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, Stream runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ReplaceContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(automationAccountName, runbookName, runbookContent, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginReplaceContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, runbookContent, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -270,6 +302,9 @@ internal RunbookDraftOperations(AutomationClient client) /// Retrieve the runbook draft identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -297,17 +332,29 @@ internal RunbookDraftOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -318,10 +365,6 @@ internal RunbookDraftOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -330,6 +373,7 @@ internal RunbookDraftOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -339,10 +383,10 @@ internal RunbookDraftOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -472,6 +516,9 @@ internal RunbookDraftOperations(AutomationClient client) /// Publish runbook draft. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -484,17 +531,20 @@ internal RunbookDraftOperations(AutomationClient client) /// /// The cancellation token. /// - public async Task> PublishWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PublishWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginPublishWithHttpMessagesAsync(automationAccountName, runbookName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginPublishWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Retrieve the runbook identified by runbook name. + /// Undo draft edit to last known published state identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -522,17 +572,29 @@ internal RunbookDraftOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UndoEditWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UndoEditWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -543,10 +605,6 @@ internal RunbookDraftOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -555,6 +613,7 @@ internal RunbookDraftOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -564,10 +623,10 @@ internal RunbookDraftOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -694,9 +753,12 @@ internal RunbookDraftOperations(AutomationClient client) } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -715,6 +777,9 @@ internal RunbookDraftOperations(AutomationClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -724,17 +789,29 @@ internal RunbookDraftOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginCreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, Stream runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginReplaceContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -749,10 +826,6 @@ internal RunbookDraftOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookContent"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -761,20 +834,21 @@ internal RunbookDraftOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("runbookContent", runbookContent); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginReplaceContent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -818,14 +892,11 @@ internal RunbookDraftOperations(AutomationClient client) // Serialize Request string _requestContent = null; - if(runbookContent == null) - { - throw new System.ArgumentNullException("runbookContent"); - } - if (runbookContent != null && runbookContent != Stream.Null) + if(runbookContent != null) { - _httpRequest.Content = new StreamContent(runbookContent); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runbookContent, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("text/powershell"); } // Set Credentials if (Client.Credentials != null) @@ -877,13 +948,44 @@ internal RunbookDraftOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -895,6 +997,9 @@ internal RunbookDraftOperations(AutomationClient client) /// Publish runbook draft. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -922,17 +1027,29 @@ internal RunbookDraftOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPublishWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginPublishWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -943,10 +1060,6 @@ internal RunbookDraftOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -955,6 +1068,7 @@ internal RunbookDraftOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -964,10 +1078,10 @@ internal RunbookDraftOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1061,7 +1175,7 @@ internal RunbookDraftOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1074,7 +1188,7 @@ internal RunbookDraftOperations(AutomationClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1086,6 +1200,19 @@ internal RunbookDraftOperations(AutomationClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperationsExtensions.cs index 629174dd9e89..e1b4d6453cab 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/RunbookDraftOperationsExtensions.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Management.Automation using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -29,15 +28,18 @@ public static partial class RunbookDraftOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static Stream GetContent(this IRunbookDraftOperations operations, string automationAccountName, string runbookName) + public static string GetContent(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.GetContentAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.GetContentAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -47,6 +49,9 @@ public static Stream GetContent(this IRunbookDraftOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -56,20 +61,24 @@ public static Stream GetContent(this IRunbookDraftOperations operations, string /// /// The cancellation token. /// - public static async Task GetContentAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetContentAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetContentWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -79,18 +88,21 @@ public static Stream GetContent(this IRunbookDraftOperations operations, string /// /// The runbook draft content. /// - public static void CreateOrUpdate(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, Stream runbookContent) + public static string ReplaceContent(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string runbookContent) { - operations.CreateOrUpdateAsync(automationAccountName, runbookName, runbookContent).GetAwaiter().GetResult(); + return operations.ReplaceContentAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).GetAwaiter().GetResult(); } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -103,9 +115,12 @@ public static void CreateOrUpdate(this IRunbookDraftOperations operations, strin /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, Stream runbookContent, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ReplaceContentAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, runbookName, runbookContent, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ReplaceContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, runbookContent, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -115,15 +130,18 @@ public static void CreateOrUpdate(this IRunbookDraftOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static RunbookDraft Get(this IRunbookDraftOperations operations, string automationAccountName, string runbookName) + public static RunbookDraft Get(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.GetAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -133,6 +151,9 @@ public static RunbookDraft Get(this IRunbookDraftOperations operations, string a /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -142,9 +163,9 @@ public static RunbookDraft Get(this IRunbookDraftOperations operations, string a /// /// The cancellation token. /// - public static async Task GetAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -157,15 +178,18 @@ public static RunbookDraft Get(this IRunbookDraftOperations operations, string a /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The parameters supplied to the publish runbook operation. /// - public static Runbook Publish(this IRunbookDraftOperations operations, string automationAccountName, string runbookName) + public static string Publish(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.PublishAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.PublishAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -175,6 +199,9 @@ public static Runbook Publish(this IRunbookDraftOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -184,39 +211,45 @@ public static Runbook Publish(this IRunbookDraftOperations operations, string au /// /// The cancellation token. /// - public static async Task PublishAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PublishAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PublishWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PublishWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieve the runbook identified by runbook name. + /// Undo draft edit to last known published state identified by runbook name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static RunbookDraftUndoEditResult UndoEdit(this IRunbookDraftOperations operations, string automationAccountName, string runbookName) + public static RunbookDraftUndoEditResult UndoEdit(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.UndoEditAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.UndoEditAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// - /// Retrieve the runbook identified by runbook name. + /// Undo draft edit to last known published state identified by runbook name. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -226,21 +259,24 @@ public static RunbookDraftUndoEditResult UndoEdit(this IRunbookDraftOperations o /// /// The cancellation token. /// - public static async Task UndoEditAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UndoEditAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UndoEditWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UndoEditWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -250,18 +286,21 @@ public static RunbookDraftUndoEditResult UndoEdit(this IRunbookDraftOperations o /// /// The runbook draft content. /// - public static void BeginCreateOrUpdate(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, Stream runbookContent) + public static string BeginReplaceContent(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string runbookContent) { - operations.BeginCreateOrUpdateAsync(automationAccountName, runbookName, runbookContent).GetAwaiter().GetResult(); + return operations.BeginReplaceContentAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).GetAwaiter().GetResult(); } /// - /// Updates the runbook draft with runbookStream as its content. + /// Replaces the runbook draft content. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -274,9 +313,12 @@ public static void BeginCreateOrUpdate(this IRunbookDraftOperations operations, /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, Stream runbookContent, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginReplaceContentAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string runbookContent, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginCreateOrUpdateWithHttpMessagesAsync(automationAccountName, runbookName, runbookContent, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginReplaceContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, runbookContent, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -286,15 +328,18 @@ public static void BeginCreateOrUpdate(this IRunbookDraftOperations operations, /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The parameters supplied to the publish runbook operation. /// - public static Runbook BeginPublish(this IRunbookDraftOperations operations, string automationAccountName, string runbookName) + public static string BeginPublish(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.BeginPublishAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.BeginPublishAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -304,6 +349,9 @@ public static Runbook BeginPublish(this IRunbookDraftOperations operations, stri /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -313,9 +361,9 @@ public static Runbook BeginPublish(this IRunbookDraftOperations operations, stri /// /// The cancellation token. /// - public static async Task BeginPublishAsync(this IRunbookDraftOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginPublishAsync(this IRunbookDraftOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginPublishWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginPublishWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/RunbookOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/RunbookOperations.cs index ccfe808d165f..3fca4ba91034 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/RunbookOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/RunbookOperations.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Automation using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -55,6 +54,9 @@ internal RunbookOperations(AutomationClient client) /// Retrieve the content of runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -67,7 +69,7 @@ internal RunbookOperations(AutomationClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,17 +84,29 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetContentWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetContentWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -103,10 +117,6 @@ internal RunbookOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -115,6 +125,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -124,10 +135,10 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -183,7 +194,7 @@ internal RunbookOperations(AutomationClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -193,13 +204,14 @@ internal RunbookOperations(AutomationClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,6 +221,10 @@ internal RunbookOperations(AutomationClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -221,7 +237,7 @@ internal RunbookOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,7 +247,20 @@ internal RunbookOperations(AutomationClient client) // Deserialize Response if ((int)_statusCode == 200) { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } } if (_shouldTrace) { @@ -244,6 +273,9 @@ internal RunbookOperations(AutomationClient client) /// Retrieve the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -271,17 +303,29 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -292,10 +336,6 @@ internal RunbookOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -304,6 +344,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -313,10 +354,10 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -446,6 +487,9 @@ internal RunbookOperations(AutomationClient client) /// Create the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -465,6 +509,9 @@ internal RunbookOperations(AutomationClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -474,17 +521,29 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -503,10 +562,6 @@ internal RunbookOperations(AutomationClient client) { parameters.Validate(); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -515,6 +570,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("parameters", parameters); @@ -525,10 +581,10 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -628,13 +684,49 @@ internal RunbookOperations(AutomationClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -646,6 +738,9 @@ internal RunbookOperations(AutomationClient client) /// Update the runbook identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -676,17 +771,29 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string runbookName, RunbookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -701,10 +808,6 @@ internal RunbookOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -713,6 +816,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("parameters", parameters); @@ -723,10 +827,10 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -862,6 +966,9 @@ internal RunbookOperations(AutomationClient client) /// Delete the runbook by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -886,17 +993,29 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -907,10 +1026,6 @@ internal RunbookOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -919,6 +1034,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -928,10 +1044,10 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -995,7 +1111,7 @@ internal RunbookOperations(AutomationClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1043,6 +1159,9 @@ internal RunbookOperations(AutomationClient client) /// Retrieve a list of runbooks. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -1067,27 +1186,35 @@ internal RunbookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1096,6 +1223,7 @@ internal RunbookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1104,9 +1232,9 @@ internal RunbookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/RunbookOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/RunbookOperationsExtensions.cs index 69dddef3a867..8bae46c4b752 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/RunbookOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/RunbookOperationsExtensions.cs @@ -13,7 +13,6 @@ namespace Microsoft.Azure.Management.Automation using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.IO; using System.Threading; using System.Threading.Tasks; @@ -29,15 +28,18 @@ public static partial class RunbookOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static Stream GetContent(this IRunbookOperations operations, string automationAccountName, string runbookName) + public static string GetContent(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.GetContentAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.GetContentAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -47,6 +49,9 @@ public static Stream GetContent(this IRunbookOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -56,11 +61,12 @@ public static Stream GetContent(this IRunbookOperations operations, string autom /// /// The cancellation token. /// - public static async Task GetContentAsync(this IRunbookOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetContentAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - var _result = await operations.GetContentWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; + using (var _result = await operations.GetContentWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -70,15 +76,18 @@ public static Stream GetContent(this IRunbookOperations operations, string autom /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static Runbook Get(this IRunbookOperations operations, string automationAccountName, string runbookName) + public static Runbook Get(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.GetAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -88,6 +97,9 @@ public static Runbook Get(this IRunbookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -97,9 +109,9 @@ public static Runbook Get(this IRunbookOperations operations, string automationA /// /// The cancellation token. /// - public static async Task GetAsync(this IRunbookOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -112,6 +124,9 @@ public static Runbook Get(this IRunbookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -122,9 +137,9 @@ public static Runbook Get(this IRunbookOperations operations, string automationA /// The create or update parameters for runbook. Provide either content link /// for a published runbook or draft, not both. /// - public static void CreateOrUpdate(this IRunbookOperations operations, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters) + public static Runbook CreateOrUpdate(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters) { - operations.CreateOrUpdateAsync(automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); } /// @@ -134,6 +149,9 @@ public static void CreateOrUpdate(this IRunbookOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -147,9 +165,12 @@ public static void CreateOrUpdate(this IRunbookOperations operations, string aut /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRunbookOperations operations, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// @@ -159,6 +180,9 @@ public static void CreateOrUpdate(this IRunbookOperations operations, string aut /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -168,9 +192,9 @@ public static void CreateOrUpdate(this IRunbookOperations operations, string aut /// /// The update parameters for runbook. /// - public static Runbook Update(this IRunbookOperations operations, string automationAccountName, string runbookName, RunbookUpdateParameters parameters) + public static Runbook Update(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); } /// @@ -180,6 +204,9 @@ public static Runbook Update(this IRunbookOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -192,9 +219,9 @@ public static Runbook Update(this IRunbookOperations operations, string automati /// /// The cancellation token. /// - public static async Task UpdateAsync(this IRunbookOperations operations, string automationAccountName, string runbookName, RunbookUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, RunbookUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -207,15 +234,18 @@ public static Runbook Update(this IRunbookOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static void Delete(this IRunbookOperations operations, string automationAccountName, string runbookName) + public static void Delete(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - operations.DeleteAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -225,6 +255,9 @@ public static void Delete(this IRunbookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -234,9 +267,9 @@ public static void Delete(this IRunbookOperations operations, string automationA /// /// The cancellation token. /// - public static async Task DeleteAsync(this IRunbookOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -246,12 +279,15 @@ public static void Delete(this IRunbookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IRunbookOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IRunbookOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -261,15 +297,18 @@ public static IPage ListByAutomationAccount(this IRunbookOperations ope /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IRunbookOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IRunbookOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperations.cs index 9e6f00ac0f5d..caa675337fa5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperations.cs @@ -54,6 +54,9 @@ internal ScheduleOperations(AutomationClient client) /// Create a schedule. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +87,25 @@ internal ScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -125,6 +136,7 @@ internal ScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("scheduleName", scheduleName); tracingParameters.Add("parameters", parameters); @@ -135,7 +147,7 @@ internal ScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{scheduleName}", System.Uri.EscapeDataString(scheduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -274,6 +286,9 @@ internal ScheduleOperations(AutomationClient client) /// Update the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -304,17 +319,25 @@ internal ScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -341,6 +364,7 @@ internal ScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("scheduleName", scheduleName); tracingParameters.Add("parameters", parameters); @@ -351,7 +375,7 @@ internal ScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{scheduleName}", System.Uri.EscapeDataString(scheduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -490,6 +514,9 @@ internal ScheduleOperations(AutomationClient client) /// Retrieve the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -517,17 +544,25 @@ internal ScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -550,6 +585,7 @@ internal ScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("scheduleName", scheduleName); tracingParameters.Add("apiVersion", apiVersion); @@ -559,7 +595,7 @@ internal ScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{scheduleName}", System.Uri.EscapeDataString(scheduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -692,6 +728,9 @@ internal ScheduleOperations(AutomationClient client) /// Delete the schedule identified by schedule name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -716,17 +755,25 @@ internal ScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string scheduleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -749,6 +796,7 @@ internal ScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("scheduleName", scheduleName); tracingParameters.Add("apiVersion", apiVersion); @@ -758,7 +806,7 @@ internal ScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{scheduleName}", System.Uri.EscapeDataString(scheduleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -873,6 +921,9 @@ internal ScheduleOperations(AutomationClient client) /// Retrieve a list of schedules. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -897,17 +948,25 @@ internal ScheduleOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -926,6 +985,7 @@ internal ScheduleOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -934,7 +994,7 @@ internal ScheduleOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperationsExtensions.cs index 1730c55aa35d..51a24d569660 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/ScheduleOperationsExtensions.cs @@ -28,6 +28,9 @@ public static partial class ScheduleOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -37,9 +40,9 @@ public static partial class ScheduleOperationsExtensions /// /// The parameters supplied to the create or update schedule operation. /// - public static Schedule CreateOrUpdate(this IScheduleOperations operations, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters) + public static Schedule CreateOrUpdate(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, scheduleName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, scheduleName, parameters).GetAwaiter().GetResult(); } /// @@ -49,6 +52,9 @@ public static Schedule CreateOrUpdate(this IScheduleOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -61,9 +67,9 @@ public static Schedule CreateOrUpdate(this IScheduleOperations operations, strin /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IScheduleOperations operations, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, ScheduleCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, scheduleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, scheduleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,6 +82,9 @@ public static Schedule CreateOrUpdate(this IScheduleOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -85,9 +94,9 @@ public static Schedule CreateOrUpdate(this IScheduleOperations operations, strin /// /// The parameters supplied to the update schedule operation. /// - public static Schedule Update(this IScheduleOperations operations, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters) + public static Schedule Update(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, scheduleName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, scheduleName, parameters).GetAwaiter().GetResult(); } /// @@ -97,6 +106,9 @@ public static Schedule Update(this IScheduleOperations operations, string automa /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -109,9 +121,9 @@ public static Schedule Update(this IScheduleOperations operations, string automa /// /// The cancellation token. /// - public static async Task UpdateAsync(this IScheduleOperations operations, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, ScheduleUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, scheduleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, scheduleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -124,15 +136,18 @@ public static Schedule Update(this IScheduleOperations operations, string automa /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The schedule name. /// - public static Schedule Get(this IScheduleOperations operations, string automationAccountName, string scheduleName) + public static Schedule Get(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName) { - return operations.GetAsync(automationAccountName, scheduleName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, scheduleName).GetAwaiter().GetResult(); } /// @@ -142,6 +157,9 @@ public static Schedule Get(this IScheduleOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -151,9 +169,9 @@ public static Schedule Get(this IScheduleOperations operations, string automatio /// /// The cancellation token. /// - public static async Task GetAsync(this IScheduleOperations operations, string automationAccountName, string scheduleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, scheduleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, scheduleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -166,15 +184,18 @@ public static Schedule Get(this IScheduleOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The schedule name. /// - public static void Delete(this IScheduleOperations operations, string automationAccountName, string scheduleName) + public static void Delete(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName) { - operations.DeleteAsync(automationAccountName, scheduleName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, scheduleName).GetAwaiter().GetResult(); } /// @@ -184,6 +205,9 @@ public static void Delete(this IScheduleOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -193,9 +217,9 @@ public static void Delete(this IScheduleOperations operations, string automation /// /// The cancellation token. /// - public static async Task DeleteAsync(this IScheduleOperations operations, string automationAccountName, string scheduleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, string scheduleName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, scheduleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, scheduleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -205,12 +229,15 @@ public static void Delete(this IScheduleOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IScheduleOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IScheduleOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -220,15 +247,18 @@ public static IPage ListByAutomationAccount(this IScheduleOperations o /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IScheduleOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IScheduleOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/SdkInfo_AutomationClient.cs b/src/SDKs/Automation/Management.Automation/Generated/SdkInfo_AutomationClient.cs index 67cb4a9aa2fb..bbf9a49e4358 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SdkInfo_AutomationClient.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SdkInfo_AutomationClient.cs @@ -12,23 +12,26 @@ public static IEnumerable> ApiInfo_AutomationClien return new Tuple[] { new Tuple("Automation", "Activity", "2015-10-31"), - new Tuple("Automation", "AgentRegistrationInformation", "2015-10-31"), + new Tuple("Automation", "AgentRegistrationInformation", "2018-01-15"), new Tuple("Automation", "AutomationAccount", "2015-10-31"), new Tuple("Automation", "Certificate", "2015-10-31"), new Tuple("Automation", "Connection", "2015-10-31"), new Tuple("Automation", "ConnectionType", "2015-10-31"), new Tuple("Automation", "Credential", "2015-10-31"), - new Tuple("Automation", "DscCompilationJob", "2015-10-31"), + new Tuple("Automation", "DscCompilationJob", "2018-01-15"), + new Tuple("Automation", "DscCompilationJobStream", "2018-01-15"), new Tuple("Automation", "DscConfiguration", "2015-10-31"), - new Tuple("Automation", "DscNode", "2015-10-31"), - new Tuple("Automation", "DscNodeConfiguration", "2015-10-31"), + new Tuple("Automation", "DscNode", "2018-01-15"), + new Tuple("Automation", "DscNodeConfiguration", "2018-01-15"), new Tuple("Automation", "Fields", "2015-10-31"), new Tuple("Automation", "HybridRunbookWorkerGroup", "2015-10-31"), - new Tuple("Automation", "Job", "2015-10-31"), + new Tuple("Automation", "Job", "2017-05-15-preview"), new Tuple("Automation", "JobSchedule", "2015-10-31"), - new Tuple("Automation", "JobStream", "2015-10-31"), + new Tuple("Automation", "JobStream", "2017-05-15-preview"), + new Tuple("Automation", "Keys", "2015-10-31"), + new Tuple("Automation", "LinkedWorkspace", "2015-10-31"), new Tuple("Automation", "Module", "2015-10-31"), - new Tuple("Automation", "NodeReports", "2015-10-31"), + new Tuple("Automation", "NodeReports", "2018-01-15"), new Tuple("Automation", "ObjectDataTypes", "2015-10-31"), new Tuple("Automation", "Operations", "2015-10-31"), new Tuple("Automation", "Runbook", "2015-10-31"), @@ -37,9 +40,11 @@ public static IEnumerable> ApiInfo_AutomationClien new Tuple("Automation", "SoftwareUpdateConfigurationMachineRuns", "2017-05-15-preview"), new Tuple("Automation", "SoftwareUpdateConfigurationRuns", "2017-05-15-preview"), new Tuple("Automation", "SoftwareUpdateConfigurations", "2017-05-15-preview"), + new Tuple("Automation", "SourceControl", "2017-05-15-preview"), + new Tuple("Automation", "SourceControlSyncJob", "2017-05-15-preview"), new Tuple("Automation", "Statistics", "2015-10-31"), + new Tuple("Automation", "TestJob", "2015-10-31"), new Tuple("Automation", "TestJobStreams", "2015-10-31"), - new Tuple("Automation", "TestJobs", "2015-10-31"), new Tuple("Automation", "Usages", "2015-10-31"), new Tuple("Automation", "Variable", "2015-10-31"), new Tuple("Automation", "Webhook", "2015-10-31"), diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperations.cs index 41afe33d8419..e782cb92fc3e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperations.cs @@ -54,9 +54,18 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien /// Get a single software update configuration machine run by Id. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration machine run. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -78,26 +87,34 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(System.Guid softwareUpdateConfigurationMachineRunId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByIdWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } string apiVersion = "2017-05-15-preview"; // Tracing @@ -107,8 +124,11 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("softwareUpdateConfigurationMachineRunId", softwareUpdateConfigurationMachineRunId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } @@ -116,8 +136,8 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{softwareUpdateConfigurationMachineRunId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softwareUpdateConfigurationMachineRunId, Client.SerializationSettings).Trim('"'))); List _queryParameters = new List(); if (apiVersion != null) @@ -138,13 +158,13 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { @@ -261,6 +281,15 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien /// Return list of software update configuration machine runs /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -293,26 +322,34 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } string apiVersion = "2017-05-15-preview"; // Tracing @@ -322,7 +359,10 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("filter", filter); tracingParameters.Add("skip", skip); tracingParameters.Add("top", top); @@ -333,8 +373,8 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -366,13 +406,13 @@ internal SoftwareUpdateConfigurationMachineRunsOperations(AutomationClient clien { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs index 5c743aa9eb64..53eb6104244e 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationMachineRunsOperationsExtensions.cs @@ -28,12 +28,21 @@ public static partial class SoftwareUpdateConfigurationMachineRunsOperationsExte /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration machine run. /// - public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdateConfigurationMachineRunsOperations operations, System.Guid softwareUpdateConfigurationMachineRunId) + /// + /// Identifies this specific client request. + /// + public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = default(string)) { - return operations.GetByIdAsync(softwareUpdateConfigurationMachineRunId).GetAwaiter().GetResult(); + return operations.GetByIdAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunId, clientRequestId).GetAwaiter().GetResult(); } /// @@ -43,15 +52,24 @@ public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdate /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration machine run. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task GetByIdAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, System.Guid softwareUpdateConfigurationMachineRunId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByIdAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationMachineRunId, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(softwareUpdateConfigurationMachineRunId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByIdWithHttpMessagesAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunId, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -64,6 +82,15 @@ public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdate /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -75,9 +102,9 @@ public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdate /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationMachineRunListResult List(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string filter = default(string), string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationMachineRunListResult List(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string)) { - return operations.ListAsync(filter, skip, top).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, automationAccountName, clientRequestId, filter, skip, top).GetAwaiter().GetResult(); } /// @@ -87,6 +114,15 @@ public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdate /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -101,9 +137,9 @@ public static SoftwareUpdateConfigurationMachineRun GetById(this ISoftwareUpdate /// /// The cancellation token. /// - public static async Task ListAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string filter = default(string), string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this ISoftwareUpdateConfigurationMachineRunsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, clientRequestId, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperations.cs index 769986d64179..06c8f1214ab2 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperations.cs @@ -54,9 +54,18 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) /// Get a single software update configuration Run by Id. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration run. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -78,26 +87,34 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(System.Guid softwareUpdateConfigurationRunId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByIdWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationRunId, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } string apiVersion = "2017-05-15-preview"; // Tracing @@ -107,8 +124,11 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("softwareUpdateConfigurationRunId", softwareUpdateConfigurationRunId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } @@ -116,8 +136,8 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{softwareUpdateConfigurationRunId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(softwareUpdateConfigurationRunId, Client.SerializationSettings).Trim('"'))); List _queryParameters = new List(); if (apiVersion != null) @@ -138,13 +158,13 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { @@ -261,6 +281,15 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) /// Return list of software update configuration runs /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -293,26 +322,34 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } string apiVersion = "2017-05-15-preview"; // Tracing @@ -322,7 +359,10 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("filter", filter); tracingParameters.Add("skip", skip); tracingParameters.Add("top", top); @@ -333,8 +373,8 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -366,13 +406,13 @@ internal SoftwareUpdateConfigurationRunsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperationsExtensions.cs index 5f7e19493938..1914362e4b51 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationRunsOperationsExtensions.cs @@ -28,12 +28,21 @@ public static partial class SoftwareUpdateConfigurationRunsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration run. /// - public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigurationRunsOperations operations, System.Guid softwareUpdateConfigurationRunId) + /// + /// Identifies this specific client request. + /// + public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationRunId, string clientRequestId = default(string)) { - return operations.GetByIdAsync(softwareUpdateConfigurationRunId).GetAwaiter().GetResult(); + return operations.GetByIdAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationRunId, clientRequestId).GetAwaiter().GetResult(); } /// @@ -43,15 +52,24 @@ public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigu /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The Id of the software update configuration run. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task GetByIdAsync(this ISoftwareUpdateConfigurationRunsOperations operations, System.Guid softwareUpdateConfigurationRunId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByIdAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, System.Guid softwareUpdateConfigurationRunId, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(softwareUpdateConfigurationRunId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByIdWithHttpMessagesAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationRunId, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -64,6 +82,15 @@ public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigu /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -75,9 +102,9 @@ public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigu /// /// Maximum number of entries returned in the results collection /// - public static SoftwareUpdateConfigurationRunListResult List(this ISoftwareUpdateConfigurationRunsOperations operations, string filter = default(string), string skip = default(string), string top = default(string)) + public static SoftwareUpdateConfigurationRunListResult List(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string)) { - return operations.ListAsync(filter, skip, top).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, automationAccountName, clientRequestId, filter, skip, top).GetAwaiter().GetResult(); } /// @@ -87,6 +114,15 @@ public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigu /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. You can use the following filters: /// 'properties/osType', 'properties/status', 'properties/startTime', and @@ -101,9 +137,9 @@ public static SoftwareUpdateConfigurationRun GetById(this ISoftwareUpdateConfigu /// /// The cancellation token. /// - public static async Task ListAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string filter = default(string), string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this ISoftwareUpdateConfigurationRunsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), string skip = default(string), string top = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, clientRequestId, filter, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperations.cs index 4f497e904716..70939562dbae 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperations.cs @@ -54,12 +54,21 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// Create a new software update configuration with the name given in the URI. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// /// /// Request body. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -81,26 +90,34 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } if (softwareUpdateConfigurationName == null) { @@ -122,8 +139,11 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("softwareUpdateConfigurationName", softwareUpdateConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); @@ -132,8 +152,8 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{softwareUpdateConfigurationName}", System.Uri.EscapeDataString(softwareUpdateConfigurationName)); List _queryParameters = new List(); if (apiVersion != null) @@ -154,13 +174,13 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { @@ -301,9 +321,18 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// Get a single software update configuration by name. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -325,26 +354,34 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByNameWithHttpMessagesAsync(string softwareUpdateConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } if (softwareUpdateConfigurationName == null) { @@ -358,8 +395,11 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("softwareUpdateConfigurationName", softwareUpdateConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); } @@ -367,8 +407,8 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{softwareUpdateConfigurationName}", System.Uri.EscapeDataString(softwareUpdateConfigurationName)); List _queryParameters = new List(); if (apiVersion != null) @@ -389,13 +429,13 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { @@ -512,9 +552,18 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// delete a specific software update configuration. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// Headers that will be added to request. /// @@ -533,26 +582,34 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string softwareUpdateConfigurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } if (softwareUpdateConfigurationName == null) { @@ -566,8 +623,11 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("softwareUpdateConfigurationName", softwareUpdateConfigurationName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -575,8 +635,8 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{softwareUpdateConfigurationName}", System.Uri.EscapeDataString(softwareUpdateConfigurationName)); List _queryParameters = new List(); if (apiVersion != null) @@ -597,13 +657,13 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { @@ -702,6 +762,15 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// Get all software update configurations for the account. /// /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. /// @@ -726,26 +795,34 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (Client.AutomationAccountName == null) + if (automationAccountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AutomationAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); } string apiVersion = "2017-05-15-preview"; // Tracing @@ -755,7 +832,10 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientRequestId", clientRequestId); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); @@ -764,8 +844,8 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); - _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(Client.AutomationAccountName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -789,13 +869,13 @@ internal SoftwareUpdateConfigurationsOperations(AutomationClient client) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.ClientRequestId != null) + if (clientRequestId != null) { if (_httpRequest.Headers.Contains("clientRequestId")) { _httpRequest.Headers.Remove("clientRequestId"); } - _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", Client.ClientRequestId); + _httpRequest.Headers.TryAddWithoutValidation("clientRequestId", clientRequestId); } if (Client.AcceptLanguage != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperationsExtensions.cs index bca854b6a29a..abc52bac3852 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/SoftwareUpdateConfigurationsOperationsExtensions.cs @@ -28,15 +28,24 @@ public static partial class SoftwareUpdateConfigurationsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// /// /// Request body. /// - public static SoftwareUpdateConfiguration Create(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters) + /// + /// Identifies this specific client request. + /// + public static SoftwareUpdateConfiguration Create(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, string clientRequestId = default(string)) { - return operations.CreateAsync(softwareUpdateConfigurationName, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestId).GetAwaiter().GetResult(); } /// @@ -46,18 +55,27 @@ public static SoftwareUpdateConfiguration Create(this ISoftwareUpdateConfigurati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// /// /// Request body. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task CreateAsync(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, SoftwareUpdateConfiguration parameters, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(softwareUpdateConfigurationName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -70,12 +88,21 @@ public static SoftwareUpdateConfiguration Create(this ISoftwareUpdateConfigurati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// - public static SoftwareUpdateConfiguration GetByName(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName) + /// + /// Identifies this specific client request. + /// + public static SoftwareUpdateConfiguration GetByName(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string)) { - return operations.GetByNameAsync(softwareUpdateConfigurationName).GetAwaiter().GetResult(); + return operations.GetByNameAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestId).GetAwaiter().GetResult(); } /// @@ -85,15 +112,24 @@ public static SoftwareUpdateConfiguration GetByName(this ISoftwareUpdateConfigur /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task GetByNameAsync(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByNameAsync(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByNameWithHttpMessagesAsync(softwareUpdateConfigurationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -106,12 +142,21 @@ public static SoftwareUpdateConfiguration GetByName(this ISoftwareUpdateConfigur /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// - public static void Delete(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName) + /// + /// Identifies this specific client request. + /// + public static void Delete(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string)) { - operations.DeleteAsync(softwareUpdateConfigurationName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestId).GetAwaiter().GetResult(); } /// @@ -121,15 +166,24 @@ public static void Delete(this ISoftwareUpdateConfigurationsOperations operation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// /// /// The name of the software update configuration to be created. /// + /// + /// Identifies this specific client request. + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISoftwareUpdateConfigurationsOperations operations, string softwareUpdateConfigurationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string softwareUpdateConfigurationName, string clientRequestId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(softwareUpdateConfigurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -139,12 +193,21 @@ public static void Delete(this ISoftwareUpdateConfigurationsOperations operation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. /// - public static SoftwareUpdateConfigurationListResult List(this ISoftwareUpdateConfigurationsOperations operations, string filter = default(string)) + public static SoftwareUpdateConfigurationListResult List(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string)) { - return operations.ListAsync(filter).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, automationAccountName, clientRequestId, filter).GetAwaiter().GetResult(); } /// @@ -154,15 +217,24 @@ public static void Delete(this ISoftwareUpdateConfigurationsOperations operation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// Identifies this specific client request. + /// /// /// The filter to apply on the operation. /// /// /// The cancellation token. /// - public static async Task ListAsync(this ISoftwareUpdateConfigurationsOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAsync(this ISoftwareUpdateConfigurationsOperations operations, string resourceGroupName, string automationAccountName, string clientRequestId = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, automationAccountName, clientRequestId, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperations.cs new file mode 100644 index 000000000000..d6a501c0e5fe --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperations.cs @@ -0,0 +1,1321 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SourceControlOperations operations. + /// + internal partial class SourceControlOperations : IServiceOperations, ISourceControlOperations + { + /// + /// Initializes a new instance of the SourceControlOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SourceControlOperations(AutomationClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AutomationClient + /// + public AutomationClient Client { get; private set; } + + /// + /// Create a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the create or update source control operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the update source control operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete the source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve the source control identified by source control name. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperationsExtensions.cs new file mode 100644 index 000000000000..1a22b6dbe960 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/SourceControlOperationsExtensions.cs @@ -0,0 +1,310 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SourceControlOperations. + /// + public static partial class SourceControlOperationsExtensions + { + /// + /// Create a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the create or update source control operation. + /// + public static SourceControl CreateOrUpdate(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlCreateOrUpdateParameters parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, sourceControlName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the create or update source control operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the update source control operation. + /// + public static SourceControl Update(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, automationAccountName, sourceControlName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The parameters supplied to the update source control operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, SourceControlUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + public static void Delete(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName) + { + operations.DeleteAsync(resourceGroupName, automationAccountName, sourceControlName).GetAwaiter().GetResult(); + } + + /// + /// Delete the source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieve the source control identified by source control name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + public static SourceControl Get(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName) + { + return operations.GetAsync(resourceGroupName, automationAccountName, sourceControlName).GetAwaiter().GetResult(); + } + + /// + /// Retrieve the source control identified by source control name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The name of source control. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The filter to apply on the operation. + /// + public static IPage ListByAutomationAccount(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string)) + { + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, filter).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountAsync(this ISourceControlOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByAutomationAccountNext(this ISourceControlOperations operations, string nextPageLink) + { + return operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a list of source controls. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountNextAsync(this ISourceControlOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperations.cs new file mode 100644 index 000000000000..4732b906b1b4 --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperations.cs @@ -0,0 +1,883 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SourceControlSyncJobOperations operations. + /// + internal partial class SourceControlSyncJobOperations : IServiceOperations, ISourceControlSyncJobOperations + { + /// + /// Initializes a new instance of the SourceControlSyncJobOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SourceControlSyncJobOperations(AutomationClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AutomationClient + /// + public AutomationClient Client { get; private set; } + + /// + /// Creates the sync job for a source control. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("sourceControlSyncJobId", sourceControlSyncJobId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{sourceControlSyncJobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sourceControlSyncJobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve the source control sync job identified by job id. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("sourceControlSyncJobId", sourceControlSyncJobId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{sourceControlSyncJobId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(sourceControlSyncJobId, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string sourceControlName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (automationAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "automationAccountName"); + } + if (sourceControlName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-05-15-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("automationAccountName", automationAccountName); + tracingParameters.Add("sourceControlName", sourceControlName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); + _url = _url.Replace("{sourceControlName}", System.Uri.EscapeDataString(sourceControlName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByAutomationAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByAutomationAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperationsExtensions.cs new file mode 100644 index 000000000000..7af64484a04c --- /dev/null +++ b/src/SDKs/Automation/Management.Automation/Generated/SourceControlSyncJobOperationsExtensions.cs @@ -0,0 +1,223 @@ +// +// 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 Microsoft.Azure.Management.Automation +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SourceControlSyncJobOperations. + /// + public static partial class SourceControlSyncJobOperationsExtensions + { + /// + /// Creates the sync job for a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + public static SourceControlSyncJob Create(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId) + { + return operations.CreateAsync(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId).GetAwaiter().GetResult(); + } + + /// + /// Creates the sync job for a source control. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve the source control sync job identified by job id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + public static SourceControlSyncJobById Get(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId) + { + return operations.GetAsync(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId).GetAwaiter().GetResult(); + } + + /// + /// Retrieve the source control sync job identified by job id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The source control sync job id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, System.Guid sourceControlSyncJobId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The filter to apply on the operation. + /// + public static IPage ListByAutomationAccount(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, string filter = default(string)) + { + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, sourceControlName, filter).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure Resource group. + /// + /// + /// The name of the automation account. + /// + /// + /// The source control name. + /// + /// + /// The filter to apply on the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountAsync(this ISourceControlSyncJobOperations operations, string resourceGroupName, string automationAccountName, string sourceControlName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, sourceControlName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByAutomationAccountNext(this ISourceControlSyncJobOperations operations, string nextPageLink) + { + return operations.ListByAutomationAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a list of source control sync jobs. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAutomationAccountNextAsync(this ISourceControlSyncJobOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByAutomationAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Automation/Management.Automation/Generated/TestJobsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/TestJobOperations.cs similarity index 89% rename from src/SDKs/Automation/Management.Automation/Generated/TestJobsOperations.cs rename to src/SDKs/Automation/Management.Automation/Generated/TestJobOperations.cs index 5aee62dbccfd..a14f49ed0757 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/TestJobsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/TestJobOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Automation using System.Threading.Tasks; /// - /// TestJobsOperations operations. + /// TestJobOperations operations. /// - internal partial class TestJobsOperations : IServiceOperations, ITestJobsOperations + internal partial class TestJobOperations : IServiceOperations, ITestJobOperations { /// - /// Initializes a new instance of the TestJobsOperations class. + /// Initializes a new instance of the TestJobOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class TestJobsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal TestJobsOperations(AutomationClient client) + internal TestJobOperations(AutomationClient client) { if (client == null) { @@ -54,6 +54,9 @@ internal TestJobsOperations(AutomationClient client) /// Create a test job of the runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +87,29 @@ internal TestJobsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string automationAccountName, string runbookName, TestJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, TestJobCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -109,14 +124,6 @@ internal TestJobsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -125,6 +132,7 @@ internal TestJobsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("parameters", parameters); @@ -135,10 +143,10 @@ internal TestJobsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -274,6 +282,9 @@ internal TestJobsOperations(AutomationClient client) /// Retrieve the test job for the specified runbook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -301,17 +312,29 @@ internal TestJobsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -322,10 +345,6 @@ internal TestJobsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -334,6 +353,7 @@ internal TestJobsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -343,10 +363,10 @@ internal TestJobsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -476,6 +496,9 @@ internal TestJobsOperations(AutomationClient client) /// Resume the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -500,17 +523,29 @@ internal TestJobsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResumeWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ResumeWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -521,10 +556,6 @@ internal TestJobsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -533,6 +564,7 @@ internal TestJobsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -542,10 +574,10 @@ internal TestJobsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -657,6 +689,9 @@ internal TestJobsOperations(AutomationClient client) /// Stop the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -681,17 +716,29 @@ internal TestJobsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task StopWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -702,10 +749,6 @@ internal TestJobsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -714,6 +757,7 @@ internal TestJobsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -723,10 +767,10 @@ internal TestJobsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -838,6 +882,9 @@ internal TestJobsOperations(AutomationClient client) /// Suspend the test job. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -862,17 +909,29 @@ internal TestJobsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task SuspendWithHttpMessagesAsync(string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task SuspendWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -883,10 +942,6 @@ internal TestJobsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -895,6 +950,7 @@ internal TestJobsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("apiVersion", apiVersion); @@ -904,10 +960,10 @@ internal TestJobsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/TestJobsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/TestJobOperationsExtensions.cs similarity index 62% rename from src/SDKs/Automation/Management.Automation/Generated/TestJobsOperationsExtensions.cs rename to src/SDKs/Automation/Management.Automation/Generated/TestJobOperationsExtensions.cs index efe2bf4bacad..05372152a2f1 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/TestJobsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/TestJobOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.Automation using System.Threading.Tasks; /// - /// Extension methods for TestJobsOperations. + /// Extension methods for TestJobOperations. /// - public static partial class TestJobsOperationsExtensions + public static partial class TestJobOperationsExtensions { /// /// Create a test job of the runbook. @@ -28,6 +28,9 @@ public static partial class TestJobsOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -37,9 +40,9 @@ public static partial class TestJobsOperationsExtensions /// /// The parameters supplied to the create test job operation. /// - public static TestJob Create(this ITestJobsOperations operations, string automationAccountName, string runbookName, TestJobCreateParameters parameters) + public static TestJob Create(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, TestJobCreateParameters parameters) { - return operations.CreateAsync(automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, automationAccountName, runbookName, parameters).GetAwaiter().GetResult(); } /// @@ -49,6 +52,9 @@ public static TestJob Create(this ITestJobsOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -61,9 +67,9 @@ public static TestJob Create(this ITestJobsOperations operations, string automat /// /// The cancellation token. /// - public static async Task CreateAsync(this ITestJobsOperations operations, string automationAccountName, string runbookName, TestJobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, TestJobCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,15 +82,18 @@ public static TestJob Create(this ITestJobsOperations operations, string automat /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static TestJob Get(this ITestJobsOperations operations, string automationAccountName, string runbookName) + public static TestJob Get(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - return operations.GetAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -94,6 +103,9 @@ public static TestJob Get(this ITestJobsOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -103,9 +115,9 @@ public static TestJob Get(this ITestJobsOperations operations, string automation /// /// The cancellation token. /// - public static async Task GetAsync(this ITestJobsOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -118,15 +130,18 @@ public static TestJob Get(this ITestJobsOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static void Resume(this ITestJobsOperations operations, string automationAccountName, string runbookName) + public static void Resume(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - operations.ResumeAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + operations.ResumeAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -136,6 +151,9 @@ public static void Resume(this ITestJobsOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -145,9 +163,9 @@ public static void Resume(this ITestJobsOperations operations, string automation /// /// The cancellation token. /// - public static async Task ResumeAsync(this ITestJobsOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResumeAsync(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ResumeWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ResumeWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -157,15 +175,18 @@ public static void Resume(this ITestJobsOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static void Stop(this ITestJobsOperations operations, string automationAccountName, string runbookName) + public static void Stop(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - operations.StopAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + operations.StopAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -175,6 +196,9 @@ public static void Stop(this ITestJobsOperations operations, string automationAc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -184,9 +208,9 @@ public static void Stop(this ITestJobsOperations operations, string automationAc /// /// The cancellation token. /// - public static async Task StopAsync(this ITestJobsOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task StopAsync(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.StopWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.StopWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -196,15 +220,18 @@ public static void Stop(this ITestJobsOperations operations, string automationAc /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The runbook name. /// - public static void Suspend(this ITestJobsOperations operations, string automationAccountName, string runbookName) + public static void Suspend(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName) { - operations.SuspendAsync(automationAccountName, runbookName).GetAwaiter().GetResult(); + operations.SuspendAsync(resourceGroupName, automationAccountName, runbookName).GetAwaiter().GetResult(); } /// @@ -214,6 +241,9 @@ public static void Suspend(this ITestJobsOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -223,9 +253,9 @@ public static void Suspend(this ITestJobsOperations operations, string automatio /// /// The cancellation token. /// - public static async Task SuspendAsync(this ITestJobsOperations operations, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SuspendAsync(this ITestJobOperations operations, string resourceGroupName, string automationAccountName, string runbookName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.SuspendWithHttpMessagesAsync(automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.SuspendWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } diff --git a/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperations.cs index a11fa471f647..9928ab785f72 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperations.cs @@ -51,9 +51,13 @@ internal TestJobStreamsOperations(AutomationClient client) public AutomationClient Client { get; private set; } /// - /// Retrieve a test job streams identified by runbook name and stream id. + /// Retrieve a test job stream of the test job identified by runbook name and + /// stream id. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +88,29 @@ internal TestJobStreamsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string runbookName, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string jobStreamId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -109,10 +125,6 @@ internal TestJobStreamsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobStreamId"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -121,6 +133,7 @@ internal TestJobStreamsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("jobStreamId", jobStreamId); @@ -131,11 +144,11 @@ internal TestJobStreamsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); _url = _url.Replace("{jobStreamId}", System.Uri.EscapeDataString(jobStreamId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -265,6 +278,9 @@ internal TestJobStreamsOperations(AutomationClient client) /// Retrieve a list of test job streams identified by runbook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -295,17 +311,29 @@ internal TestJobStreamsOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByTestJobWithHttpMessagesAsync(string automationAccountName, string runbookName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByTestJobWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string runbookName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -316,10 +344,6 @@ internal TestJobStreamsOperations(AutomationClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "runbookName"); } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-10-31"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -328,6 +352,7 @@ internal TestJobStreamsOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("runbookName", runbookName); tracingParameters.Add("filter", filter); @@ -338,10 +363,10 @@ internal TestJobStreamsOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{runbookName}", System.Uri.EscapeDataString(runbookName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (filter != null) { diff --git a/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperationsExtensions.cs index 1fc7e8c7b45c..3b864aa6841a 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/TestJobStreamsOperationsExtensions.cs @@ -22,12 +22,16 @@ namespace Microsoft.Azure.Management.Automation public static partial class TestJobStreamsOperationsExtensions { /// - /// Retrieve a test job streams identified by runbook name and stream id. + /// Retrieve a test job stream of the test job identified by runbook name and + /// stream id. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -37,18 +41,22 @@ public static partial class TestJobStreamsOperationsExtensions /// /// The job stream id. /// - public static JobStream Get(this ITestJobStreamsOperations operations, string automationAccountName, string runbookName, string jobStreamId) + public static JobStream Get(this ITestJobStreamsOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string jobStreamId) { - return operations.GetAsync(automationAccountName, runbookName, jobStreamId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, runbookName, jobStreamId).GetAwaiter().GetResult(); } /// - /// Retrieve a test job streams identified by runbook name and stream id. + /// Retrieve a test job stream of the test job identified by runbook name and + /// stream id. /// /// /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -61,9 +69,9 @@ public static JobStream Get(this ITestJobStreamsOperations operations, string au /// /// The cancellation token. /// - public static async Task GetAsync(this ITestJobStreamsOperations operations, string automationAccountName, string runbookName, string jobStreamId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ITestJobStreamsOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string jobStreamId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, runbookName, jobStreamId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, jobStreamId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,6 +84,9 @@ public static JobStream Get(this ITestJobStreamsOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -85,9 +96,9 @@ public static JobStream Get(this ITestJobStreamsOperations operations, string au /// /// The filter to apply on the operation. /// - public static IPage ListByTestJob(this ITestJobStreamsOperations operations, string automationAccountName, string runbookName, string filter = default(string)) + public static IPage ListByTestJob(this ITestJobStreamsOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string filter = default(string)) { - return operations.ListByTestJobAsync(automationAccountName, runbookName, filter).GetAwaiter().GetResult(); + return operations.ListByTestJobAsync(resourceGroupName, automationAccountName, runbookName, filter).GetAwaiter().GetResult(); } /// @@ -97,6 +108,9 @@ public static JobStream Get(this ITestJobStreamsOperations operations, string au /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -109,9 +123,9 @@ public static JobStream Get(this ITestJobStreamsOperations operations, string au /// /// The cancellation token. /// - public static async Task> ListByTestJobAsync(this ITestJobStreamsOperations operations, string automationAccountName, string runbookName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByTestJobAsync(this ITestJobStreamsOperations operations, string resourceGroupName, string automationAccountName, string runbookName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByTestJobWithHttpMessagesAsync(automationAccountName, runbookName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByTestJobWithHttpMessagesAsync(resourceGroupName, automationAccountName, runbookName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/VariableOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/VariableOperations.cs index 185e178ce095..1fd8667ca73f 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/VariableOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/VariableOperations.cs @@ -54,6 +54,9 @@ internal VariableOperations(AutomationClient client) /// Create a variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -84,17 +87,25 @@ internal VariableOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -125,6 +136,7 @@ internal VariableOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("variableName", variableName); tracingParameters.Add("parameters", parameters); @@ -135,7 +147,7 @@ internal VariableOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{variableName}", System.Uri.EscapeDataString(variableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -292,6 +304,9 @@ internal VariableOperations(AutomationClient client) /// Update a variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -322,17 +337,25 @@ internal VariableOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string variableName, VariableUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, VariableUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -359,6 +382,7 @@ internal VariableOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("variableName", variableName); tracingParameters.Add("parameters", parameters); @@ -369,7 +393,7 @@ internal VariableOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{variableName}", System.Uri.EscapeDataString(variableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -508,6 +532,9 @@ internal VariableOperations(AutomationClient client) /// Delete the variable. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -532,17 +559,25 @@ internal VariableOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -565,6 +600,7 @@ internal VariableOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("variableName", variableName); tracingParameters.Add("apiVersion", apiVersion); @@ -574,7 +610,7 @@ internal VariableOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{variableName}", System.Uri.EscapeDataString(variableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -689,6 +725,9 @@ internal VariableOperations(AutomationClient client) /// Retrieve the variable identified by variable name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -716,17 +755,25 @@ internal VariableOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string variableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -749,6 +796,7 @@ internal VariableOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("variableName", variableName); tracingParameters.Add("apiVersion", apiVersion); @@ -758,7 +806,7 @@ internal VariableOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{variableName}", System.Uri.EscapeDataString(variableName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -891,6 +939,9 @@ internal VariableOperations(AutomationClient client) /// Retrieve a list of variables. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -915,17 +966,25 @@ internal VariableOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -944,6 +1003,7 @@ internal VariableOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -952,7 +1012,7 @@ internal VariableOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/VariableOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/VariableOperationsExtensions.cs index 6f3fec52a62b..74f262f0d975 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/VariableOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/VariableOperationsExtensions.cs @@ -28,6 +28,9 @@ public static partial class VariableOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -37,9 +40,9 @@ public static partial class VariableOperationsExtensions /// /// The parameters supplied to the create or update variable operation. /// - public static Variable CreateOrUpdate(this IVariableOperations operations, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters) + public static Variable CreateOrUpdate(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, variableName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, variableName, parameters).GetAwaiter().GetResult(); } /// @@ -49,6 +52,9 @@ public static Variable CreateOrUpdate(this IVariableOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -61,9 +67,9 @@ public static Variable CreateOrUpdate(this IVariableOperations operations, strin /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVariableOperations operations, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, VariableCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, variableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, variableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,6 +82,9 @@ public static Variable CreateOrUpdate(this IVariableOperations operations, strin /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -85,9 +94,9 @@ public static Variable CreateOrUpdate(this IVariableOperations operations, strin /// /// The parameters supplied to the update variable operation. /// - public static Variable Update(this IVariableOperations operations, string automationAccountName, string variableName, VariableUpdateParameters parameters) + public static Variable Update(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, VariableUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, variableName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, variableName, parameters).GetAwaiter().GetResult(); } /// @@ -97,6 +106,9 @@ public static Variable Update(this IVariableOperations operations, string automa /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -109,9 +121,9 @@ public static Variable Update(this IVariableOperations operations, string automa /// /// The cancellation token. /// - public static async Task UpdateAsync(this IVariableOperations operations, string automationAccountName, string variableName, VariableUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, VariableUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, variableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, variableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -124,15 +136,18 @@ public static Variable Update(this IVariableOperations operations, string automa /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of variable. /// - public static void Delete(this IVariableOperations operations, string automationAccountName, string variableName) + public static void Delete(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName) { - operations.DeleteAsync(automationAccountName, variableName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, variableName).GetAwaiter().GetResult(); } /// @@ -142,6 +157,9 @@ public static void Delete(this IVariableOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -151,9 +169,9 @@ public static void Delete(this IVariableOperations operations, string automation /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVariableOperations operations, string automationAccountName, string variableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, variableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, variableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -163,15 +181,18 @@ public static void Delete(this IVariableOperations operations, string automation /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The name of variable. /// - public static Variable Get(this IVariableOperations operations, string automationAccountName, string variableName) + public static Variable Get(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName) { - return operations.GetAsync(automationAccountName, variableName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, variableName).GetAwaiter().GetResult(); } /// @@ -181,6 +202,9 @@ public static Variable Get(this IVariableOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -190,9 +214,9 @@ public static Variable Get(this IVariableOperations operations, string automatio /// /// The cancellation token. /// - public static async Task GetAsync(this IVariableOperations operations, string automationAccountName, string variableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVariableOperations operations, string resourceGroupName, string automationAccountName, string variableName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, variableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, variableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -205,12 +229,15 @@ public static Variable Get(this IVariableOperations operations, string automatio /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static IPage ListByAutomationAccount(this IVariableOperations operations, string automationAccountName) + public static IPage ListByAutomationAccount(this IVariableOperations operations, string resourceGroupName, string automationAccountName) { - return operations.ListByAutomationAccountAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -220,15 +247,18 @@ public static IPage ListByAutomationAccount(this IVariableOperations o /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IVariableOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IVariableOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Generated/WebhookOperations.cs b/src/SDKs/Automation/Management.Automation/Generated/WebhookOperations.cs index 96a282e333ca..16bd48fc7319 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/WebhookOperations.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/WebhookOperations.cs @@ -54,6 +54,9 @@ internal WebhookOperations(AutomationClient client) /// Generates a Uri for use in creating a webhook. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -78,17 +81,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GenerateUriWithHttpMessagesAsync(string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GenerateUriWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -107,6 +118,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -115,7 +127,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -247,6 +259,9 @@ internal WebhookOperations(AutomationClient client) /// Delete the webhook by name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -271,17 +286,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -304,6 +327,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("apiVersion", apiVersion); @@ -313,7 +337,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -428,6 +452,9 @@ internal WebhookOperations(AutomationClient client) /// Retrieve the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -455,17 +482,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -488,6 +523,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("apiVersion", apiVersion); @@ -497,7 +533,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -630,6 +666,9 @@ internal WebhookOperations(AutomationClient client) /// Create the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -660,17 +699,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -701,6 +748,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("parameters", parameters); @@ -711,7 +759,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -868,6 +916,9 @@ internal WebhookOperations(AutomationClient client) /// Update the webhook identified by webhook name. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -898,17 +949,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string automationAccountName, string webhookName, WebhookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string webhookName, WebhookUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -935,6 +994,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("parameters", parameters); @@ -945,7 +1005,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1084,6 +1144,9 @@ internal WebhookOperations(AutomationClient client) /// Retrieve a list of webhooks. /// /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -1111,17 +1174,25 @@ internal WebhookOperations(AutomationClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAutomationAccountWithHttpMessagesAsync(string resourceGroupName, string automationAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.ResourceGroupName == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ResourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (Client.ResourceGroupName != null) + if (resourceGroupName != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(Client.ResourceGroupName, "^[-\\w\\._]+$")) + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new ValidationException(ValidationRules.Pattern, "Client.ResourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (automationAccountName == null) @@ -1140,6 +1211,7 @@ internal WebhookOperations(AutomationClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("automationAccountName", automationAccountName); tracingParameters.Add("filter", filter); tracingParameters.Add("apiVersion", apiVersion); @@ -1149,7 +1221,7 @@ internal WebhookOperations(AutomationClient client) // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(Client.ResourceGroupName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{automationAccountName}", System.Uri.EscapeDataString(automationAccountName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); diff --git a/src/SDKs/Automation/Management.Automation/Generated/WebhookOperationsExtensions.cs b/src/SDKs/Automation/Management.Automation/Generated/WebhookOperationsExtensions.cs index b293689d14f7..cf39a35ea4a5 100644 --- a/src/SDKs/Automation/Management.Automation/Generated/WebhookOperationsExtensions.cs +++ b/src/SDKs/Automation/Management.Automation/Generated/WebhookOperationsExtensions.cs @@ -28,12 +28,15 @@ public static partial class WebhookOperationsExtensions /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// - public static string GenerateUri(this IWebhookOperations operations, string automationAccountName) + public static string GenerateUri(this IWebhookOperations operations, string resourceGroupName, string automationAccountName) { - return operations.GenerateUriAsync(automationAccountName).GetAwaiter().GetResult(); + return operations.GenerateUriAsync(resourceGroupName, automationAccountName).GetAwaiter().GetResult(); } /// @@ -43,15 +46,18 @@ public static string GenerateUri(this IWebhookOperations operations, string auto /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The cancellation token. /// - public static async Task GenerateUriAsync(this IWebhookOperations operations, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GenerateUriAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GenerateUriWithHttpMessagesAsync(automationAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GenerateUriWithHttpMessagesAsync(resourceGroupName, automationAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -64,15 +70,18 @@ public static string GenerateUri(this IWebhookOperations operations, string auto /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The webhook name. /// - public static void Delete(this IWebhookOperations operations, string automationAccountName, string webhookName) + public static void Delete(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName) { - operations.DeleteAsync(automationAccountName, webhookName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, automationAccountName, webhookName).GetAwaiter().GetResult(); } /// @@ -82,6 +91,9 @@ public static void Delete(this IWebhookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -91,9 +103,9 @@ public static void Delete(this IWebhookOperations operations, string automationA /// /// The cancellation token. /// - public static async Task DeleteAsync(this IWebhookOperations operations, string automationAccountName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(automationAccountName, webhookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, automationAccountName, webhookName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -103,15 +115,18 @@ public static void Delete(this IWebhookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The webhook name. /// - public static Webhook Get(this IWebhookOperations operations, string automationAccountName, string webhookName) + public static Webhook Get(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName) { - return operations.GetAsync(automationAccountName, webhookName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, automationAccountName, webhookName).GetAwaiter().GetResult(); } /// @@ -121,6 +136,9 @@ public static Webhook Get(this IWebhookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -130,9 +148,9 @@ public static Webhook Get(this IWebhookOperations operations, string automationA /// /// The cancellation token. /// - public static async Task GetAsync(this IWebhookOperations operations, string automationAccountName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(automationAccountName, webhookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, automationAccountName, webhookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -145,6 +163,9 @@ public static Webhook Get(this IWebhookOperations operations, string automationA /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -154,9 +175,9 @@ public static Webhook Get(this IWebhookOperations operations, string automationA /// /// The create or update parameters for webhook. /// - public static Webhook CreateOrUpdate(this IWebhookOperations operations, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters) + public static Webhook CreateOrUpdate(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters) { - return operations.CreateOrUpdateAsync(automationAccountName, webhookName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, automationAccountName, webhookName, parameters).GetAwaiter().GetResult(); } /// @@ -166,6 +187,9 @@ public static Webhook CreateOrUpdate(this IWebhookOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -178,9 +202,9 @@ public static Webhook CreateOrUpdate(this IWebhookOperations operations, string /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IWebhookOperations operations, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, WebhookCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(automationAccountName, webhookName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, webhookName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -193,6 +217,9 @@ public static Webhook CreateOrUpdate(this IWebhookOperations operations, string /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -202,9 +229,9 @@ public static Webhook CreateOrUpdate(this IWebhookOperations operations, string /// /// The update parameters for webhook. /// - public static Webhook Update(this IWebhookOperations operations, string automationAccountName, string webhookName, WebhookUpdateParameters parameters) + public static Webhook Update(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, WebhookUpdateParameters parameters) { - return operations.UpdateAsync(automationAccountName, webhookName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, automationAccountName, webhookName, parameters).GetAwaiter().GetResult(); } /// @@ -214,6 +241,9 @@ public static Webhook Update(this IWebhookOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -226,9 +256,9 @@ public static Webhook Update(this IWebhookOperations operations, string automati /// /// The cancellation token. /// - public static async Task UpdateAsync(this IWebhookOperations operations, string automationAccountName, string webhookName, WebhookUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string webhookName, WebhookUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(automationAccountName, webhookName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, automationAccountName, webhookName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -241,15 +271,18 @@ public static Webhook Update(this IWebhookOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// /// /// The filter to apply on the operation. /// - public static IPage ListByAutomationAccount(this IWebhookOperations operations, string automationAccountName, string filter = default(string)) + public static IPage ListByAutomationAccount(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string)) { - return operations.ListByAutomationAccountAsync(automationAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByAutomationAccountAsync(resourceGroupName, automationAccountName, filter).GetAwaiter().GetResult(); } /// @@ -259,6 +292,9 @@ public static Webhook Update(this IWebhookOperations operations, string automati /// /// The operations group for this extension method. /// + /// + /// Name of an Azure Resource group. + /// /// /// The automation account name. /// @@ -268,9 +304,9 @@ public static Webhook Update(this IWebhookOperations operations, string automati /// /// The cancellation token. /// - public static async Task> ListByAutomationAccountAsync(this IWebhookOperations operations, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAutomationAccountAsync(this IWebhookOperations operations, string resourceGroupName, string automationAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAutomationAccountWithHttpMessagesAsync(resourceGroupName, automationAccountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/Automation/Management.Automation/Microsoft.Azure.Management.Automation.csproj b/src/SDKs/Automation/Management.Automation/Microsoft.Azure.Management.Automation.csproj index 25909c1a723b..4481fb193d76 100644 --- a/src/SDKs/Automation/Management.Automation/Microsoft.Azure.Management.Automation.csproj +++ b/src/SDKs/Automation/Management.Automation/Microsoft.Azure.Management.Automation.csproj @@ -6,12 +6,12 @@ Microsoft.Azure.Management.Automation Provides Microsoft Azure Automation management operations including the ability to create, update and delete runbooks and schedules. - 3.0.1-preview + 3.0.2-preview Microsoft Azure Automation Management Library Microsoft.Azure.Management.Automation Automation;Runbook; - Newer resources added. Major version release: SDK rebuilt using the Swagger specs - Changes in the namespaces and interfaces. Still in preview mode and contains breaking changes. + Newer resources for SourceControl and SourceControlSyncJobs added. Major version release: SDK rebuilt using the Swagger specs - Changes in the namespaces and interfaces. Still in preview mode and contains breaking changes. diff --git a/src/SDKs/Automation/Management.Automation/Properties/AssemblyInfo.cs b/src/SDKs/Automation/Management.Automation/Properties/AssemblyInfo.cs index 13fd8f64ff69..eeab9d46acfc 100644 --- a/src/SDKs/Automation/Management.Automation/Properties/AssemblyInfo.cs +++ b/src/SDKs/Automation/Management.Automation/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure Automation Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure Automation management operations including the ability to create, update and delete runbooks and schedules.")] -[assembly: AssemblyVersion("3.0.1.0")] -[assembly: AssemblyFileVersion("3.0.1.0")] +[assembly: AssemblyVersion("3.0.2.0")] +[assembly: AssemblyFileVersion("3.0.2.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/SDKs/_metadata/automation_resource-manager.txt b/src/SDKs/_metadata/automation_resource-manager.txt index 64c52b5a3410..e4df92225727 100644 --- a/src/SDKs/_metadata/automation_resource-manager.txt +++ b/src/SDKs/_metadata/automation_resource-manager.txt @@ -1,11 +1,10 @@ -2018-01-18 21:18:29 UTC +2018-04-03 21:12:47 UTC 1) azure-rest-api-specs repository information GitHub user: Azure -Branch: current -Commit: a70ffe7159e60a9548679d2924b24fc96da929a5 +Branch: master 2) AutoRest information Requested version: latest -Bootstrapper version: C:\Program Files\nodejs `-- autorest@2.0.4238 +Bootstrapper version: C:\Program Files\nodejs `-- autorest@2.0.4262 Latest installed version: