code: public Subscription limitValidity( Subscription subscription, Interval.Period newValidity ) {
      ParameterMap<String, String> params = new ParameterMap<String, String>();
      ValidationUtils.validatesIntervalPeriod( newValidity );
      params.add( "period_of_validity", newValidity.toString() );
      return RestfulUtils.update( SubscriptionService.PATH, subscription, params, false, Subscription.class, super.httpClient );
    }
docs: Change the period of validity for a subscription.
  
  @param subscription the subscription.
  @param newValidity the new validity.
  @return the updated subscription.