code: public Observable<ServiceResponse<RegenerateKeyOutputInner>> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String mediaServiceName, KeyType keyType) {
          if (this.client.subscriptionId() == null) {
              throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
          }
          if (resourceGroupName == null) {
              throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
          }
          if (mediaServiceName == null) {
              throw new IllegalArgumentException("Parameter mediaServiceName is required and cannot be null.");
          }
          if (this.client.apiVersion() == null) {
              throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
          }
          if (keyType == null) {
              throw new IllegalArgumentException("Parameter keyType is required and cannot be null.");
          }
          RegenerateKeyInput parameters = new RegenerateKeyInput();
          parameters.withKeyType(keyType);
          return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, mediaServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RegenerateKeyOutputInner>>>() {
                  @Override
                  public Observable<ServiceResponse<RegenerateKeyOutputInner>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<RegenerateKeyOutputInner> clientResponse = regenerateKeyDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Regenerates a primary or secondary key for a Media Service.
  
  @param resourceGroupName Name of the resource group within the Azure subscription.
  @param mediaServiceName Name of the Media Service.
  @param keyType The keyType indicating which key you want to regenerate, Primary or Secondary. Possible values include: 'Primary', 'Secondary'
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the RegenerateKeyOutputInner object