Change redirection

REST: POST /email/domain/{domain}/redirection/{id}/changeRedirection
@param to [required] Target of account
@param domain [required] Name of your domain name
@param id [required]
425063
public OvhTaskSpecialAccount domain_redirection_id_changeRedirection_POST(String domain, String id, String to) throws IOException {
		String qPath = "/email/domain/{domain}/redirection/{id}/changeRedirection";
		StringBuilder sb = path(qPath, domain, id);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "to", to);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhTaskSpecialAccount.class);
	}
1339768
protected <T extends AppController> HttpBuilder redirect(Class<T> controllerClass, Object id){
        return redirect(controllerClass, map("id", id));
    }
36647
public void redirect(String location) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Redirecting ({} {} to {}", "Found", HttpServletResponse.SC_FOUND, location);
        }
        try {
            response.sendRedirect(location);
        } catch (IOException ioException) {
            LOG.warn("Redirect failure", ioException);
        }
    }
673520
public void sendRedirect(String url) 
        throws IOException
    {
        if (url==null)
            throw new IllegalArgumentException();
        
        if (!URI.hasScheme(url))
        {
            StringBuffer buf = _servletHttpRequest.getHttpRequest().getRootURL();
            if (url.startsWith("/"))
                buf.append(URI.canonicalPath(url));
            else
            {
                String path=_servletHttpRequest.getRequestURI();
                String parent=(path.endsWith("/"))?path:URI.parentPath(path);
                url=URI.canonicalPath(URI.addPaths(parent,url));
                if (!url.startsWith("/"))
                    buf.append('/');
                buf.append(url);
            }
            
            url=buf.toString();
        }
        
        resetBuffer();
        
        _httpResponse.setField(HttpFields.__Location,url);
        _httpResponse.setStatus(HttpResponse.__302_Moved_Temporarily);
        complete();
    }
493792
def update_domain(self, domain, emailAddress=None, ttl=None, comment=None):
        
        if not any((emailAddress, ttl, comment)):
            raise exc.MissingDNSSettings(
                    "No settings provided to update_domain().")
        uri = "/domains/%s" % utils.get_id(domain)
        body = {"comment": comment,
                "ttl": ttl,
                "emailAddress": emailAddress,
                }
        none_keys = [key for key, val in body.items()
                if val is None]
        for none_key in none_keys:
            body.pop(none_key)
        resp, resp_body = self._async_call(uri, method="PUT", body=body,
                error_class=exc.DomainUpdateFailed, has_response=False)
        return resp_body
473167
@POST
  @Path("me/email")
  @RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
  public Response changeEmail(@Context HttpServletRequest request, EmailRequest emailRequest) {
    Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
    return changeEmail(userId, emailRequest);
  }
522656
public <T extends DObject> void subscribeToObject (int oid, Subscriber<T> target)
    {
        if (oid <= 0) {
            target.requestFailed(oid, new ObjectAccessException("Invalid oid " + oid + "."));
        } else {
            queueAction(oid, target, true);
        }
    }
55035
public static void redirect(HttpServletResponse response, String url,
                                boolean movePermanently) throws IOException {
        if (!movePermanently) {
            response.sendRedirect(url);
        } else {
            response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
            response.setHeader("Location", url);
        }
    }
651336
def resource_redirect(id):
    '''
    
    '''
    resource = get_resource(id)
    return redirect(resource.url.strip()) if resource else abort(404)
181392
public function changeDNSDomainRecord($domain, $recordId, $val, $priority)
    {
        return $this->send('v-change-dns-record', $this->userName, $domain, $recordId, $val,
            $priority);
    }
935849
public void setAddress(final String address) {
		// Do we have a subaddressing account?
		Preconditions.checkArgument(StringUtils.startsWith(this.address, accountId + "+"),
				"Mail address can only be changed when subaddressing is active");
		Preconditions.checkArgument(StringUtils.startsWith(address, accountId), "New mail address %s does not start with accountId=%s", address,
				accountId);
		log.info("Changing mail address from {} to {}", this.address, address);
		this.address = address;
	}
53654
public OvhTask changeEmail_POST(String newEmail) throws IOException {
		String qPath = "/me/changeEmail";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "newEmail", newEmail);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhTask.class);
	}
621253
public void domain_responder_account_PUT(String domain, String account, OvhResponder body) throws IOException {
		String qPath = "/email/domain/{domain}/responder/{account}";
		StringBuilder sb = path(qPath, domain, account);
		exec(qPath, "PUT", sb.toString(), body);
	}
1352978
public void domain_account_accountName_PUT(String domain, String accountName, OvhAccount body) throws IOException {
		String qPath = "/email/domain/{domain}/account/{accountName}";
		StringBuilder sb = path(qPath, domain, accountName);
		exec(qPath, "PUT", sb.toString(), body);
	}
90576
public void setId(final String id) {
        // Set the DBId as well if it isn't a new id
        if (id.matches(CSConstants.EXISTING_TOPIC_ID_REGEX)) {
            DBId = Integer.parseInt(id);
        }
        this.id = id;
    }
1010661
private function setRedirectUrl(
        RequestInterface $redirectRequest,
        ResponseInterface $response
    ) {
        $location = $response->getHeader('Location');
        $location = Url::fromString($location);

        // Combine location with the original URL if it is not absolute.
        if (!$location->isAbsolute()) {
            $originalUrl = Url::fromString($redirectRequest->getUrl());
            // Remove query string parameters and just take what is present on
            // the redirect Location header
            $originalUrl->getQuery()->clear();
            $location = $originalUrl->combine($location);
        }

        $redirectRequest->setUrl($location);
    }
1263898
@POST
  @Path("{id}/email")
  @RolesAllowed({"ROLE_ADMIN"})
  public Response changeEmail(@PathParam("id") Long userId, EmailRequest request) {
    checkNotNull(userId);
    checkEmailFormat(request.getEmail());

    boolean isSuccess = userService.changeEmailAddress(userId, request.getEmail());
    return isSuccess ? Response.noContent().build() : Response.status(Response.Status.BAD_REQUEST).build();
  }