public Observable<ServiceResponse<P2SVpnServerConfigurationInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) {
        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 (virtualWanName == null) {
            throw new IllegalArgumentException("Parameter virtualWanName is required and cannot be null.");
        }
        if (p2SVpnServerConfigurationName == null) {
            throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationName is required and cannot be null.");
        }
        if (p2SVpnServerConfigurationParameters == null) {
            throw new IllegalArgumentException("Parameter p2SVpnServerConfigurationParameters is required and cannot be null.");
        }
        Validator.validate(p2SVpnServerConfigurationParameters);
        final String apiVersion = "2018-08-01";
        return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, apiVersion, p2SVpnServerConfigurationParameters, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<P2SVpnServerConfigurationInner>>>() {
                @Override
                public Observable<ServiceResponse<P2SVpnServerConfigurationInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<P2SVpnServerConfigurationInner> clientResponse = beginCreateOrUpdateDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
public Observable < ServiceResponse < P2SVpnServerConfigurationInner > > beginCreateOrUpdateWithServiceResponseAsync ( String resourceGroupName , String virtualWanName , String p2SVpnServerConfigurationName , P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters ) { 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 ( virtualWanName == null ) { throw new IllegalArgumentException ( "Parameter virtualWanName is required and cannot be null." ) ; } if ( p2SVpnServerConfigurationName == null ) { throw new IllegalArgumentException ( "Parameter p2SVpnServerConfigurationName is required and cannot be null." ) ; } if ( p2SVpnServerConfigurationParameters == null ) { throw new IllegalArgumentException ( "Parameter p2SVpnServerConfigurationParameters is required and cannot be null." ) ; } Validator . validate ( p2SVpnServerConfigurationParameters ) ; final String apiVersion = "2018-08-01" ; return service . beginCreateOrUpdate ( this . client . subscriptionId ( ) , resourceGroupName , virtualWanName , p2SVpnServerConfigurationName , apiVersion , p2SVpnServerConfigurationParameters , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < P2SVpnServerConfigurationInner > > > ( ) { @ Override public Observable < ServiceResponse < P2SVpnServerConfigurationInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < P2SVpnServerConfigurationInner > clientResponse = beginCreateOrUpdateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; }
Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration.

@param resourceGroupName The resource group name of the VirtualWan.
@param virtualWanName The name of the VirtualWan.
@param p2SVpnServerConfigurationName The name of the P2SVpnServerConfiguration.
@param p2SVpnServerConfigurationParameters Parameters supplied to create or Update a P2SVpnServerConfiguration.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the P2SVpnServerConfigurationInner object