code: public AgentRegistrationInner regenerateKey(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) {
          return regenerateKeyWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).toBlocking().single().body();
      }
docs: Regenerate a primary or secondary agent registration key.
  
  @param resourceGroupName Name of an Azure Resource group.
  @param automationAccountName The name of the automation account.
  @param parameters The name of the agent registration key to be regenerated
  @throws IllegalArgumentException thrown if parameters fail the validation
  @throws ErrorResponseException thrown if the request is rejected by server
  @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
  @return the AgentRegistrationInner object if successful.