code: public Observable<ServiceResponse<RegistryListCredentialsResultInner>> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) {
          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 (registryName == null) {
              throw new IllegalArgumentException("Parameter registryName is required and cannot be null.");
          }
          if (name == null) {
              throw new IllegalArgumentException("Parameter name is required and cannot be null.");
          }
          final String apiVersion = "2017-10-01";
          RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters();
          regenerateCredentialParameters.withName(name);
          return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RegistryListCredentialsResultInner>>>() {
                  @Override
                  public Observable<ServiceResponse<RegistryListCredentialsResultInner>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<RegistryListCredentialsResultInner> clientResponse = regenerateCredentialDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Regenerates one of the login credentials for the specified container registry.
  
  @param resourceGroupName The name of the resource group to which the container registry belongs.
  @param registryName The name of the container registry.
  @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the RegistryListCredentialsResultInner object