public ResourceLimit build() { return new ResourceLimit(account, domain, domainId, max, resourceType); }
@Override public String toString() { return string().toString(); }
public T fromResourceLimit(ResourceLimit in) { return this .account(in.getAccount()) .domain(in.getDomain()) .domainId(in.getDomainId()) .max(in.getMax()) .resourceType(in.getResourceType()); } }
private void checkResourceLimit(ResourceLimit resourceLimit) { assert resourceLimit.getAccount() != null : resourceLimit; assert resourceLimit.getDomain() != null : resourceLimit; assert resourceLimit.getResourceType() != ResourceLimit.ResourceType.UNRECOGNIZED : resourceLimit; } }
public void testUpdateResourceLimit() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(DomainLimitAsyncClient.class, "updateResourceLimit", ResourceLimit.class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of( ResourceLimit.builder().resourceType(ResourceType.SNAPSHOT).account("foo").domainId("100").max(101).build())); assertRequestLineEquals( httpRequest, "GET http://localhost:8080/client/api?response=json&command=updateResourceLimit&resourcetype=3&account=foo&domainid=100&max=101 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class); checkFilters(httpRequest); } }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof ResourceLimit, "this binder is only valid for ResourceLimit"); ResourceLimit limit = (ResourceLimit) input; Builder<String, String> builder = ImmutableMultimap.<String, String> builder(); builder.put("resourcetype", limit.getResourceType().getCode() + ""); builder.put("account", limit.getAccount()); builder.put("domainid", limit.getDomainId()); builder.put("max", limit.getMax() + ""); return (R) request.toBuilder().replaceQueryParams(builder.build()).build(); } }
private void checkResourceLimit(ResourceLimit resourceLimit) { assert resourceLimit.getAccount() != null : resourceLimit; assert resourceLimit.getDomain() != null : resourceLimit; assert resourceLimit.getResourceType() != ResourceLimit.ResourceType.UNRECOGNIZED : resourceLimit; } }
public void testUpdateResourceLimit() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(DomainLimitApi.class, "updateResourceLimit", ResourceLimit.class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of( ResourceLimit.builder().resourceType(ResourceType.SNAPSHOT).account("foo").domainId("100").max(101).build())); assertRequestLineEquals( httpRequest, "GET http://localhost:8080/client/api?response=json&command=updateResourceLimit&resourcetype=3&account=foo&domainid=100&max=101 HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class); checkFilters(httpRequest); } }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof ResourceLimit, "this binder is only valid for ResourceLimit"); ResourceLimit limit = (ResourceLimit) input; Builder<String, String> builder = ImmutableMultimap.<String, String> builder(); builder.put("resourcetype", limit.getResourceType().getCode() + ""); builder.put("account", limit.getAccount()); builder.put("domainid", limit.getDomainId()); builder.put("max", limit.getMax() + ""); return (R) request.toBuilder().replaceQueryParams(builder.build()).build(); } }
public ResourceLimit build() { return new ResourceLimit(account, domain, domainId, max, resourceType); }
@Override public String toString() { return string().toString(); }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof ResourceLimit, "this binder is only valid for ResourceLimit"); ResourceLimit limit = (ResourceLimit) input; Builder<String, String> builder = ImmutableMultimap.<String, String> builder(); builder.put("resourcetype", limit.getResourceType().getCode() + ""); builder.put("account", limit.getAccount()); builder.put("domainid", limit.getDomainId()); builder.put("max", limit.getMax() + ""); return (R) request.toBuilder().replaceQueryParams(builder.build()).build(); } }
public ResourceLimit build() { return new ResourceLimit(account, domain, domainId, max, resourceType); }
@Override public String toString() { return string().toString(); }
public T fromResourceLimit(ResourceLimit in) { return this .account(in.getAccount()) .domain(in.getDomain()) .domainId(in.getDomainId()) .max(in.getMax()) .resourceType(in.getResourceType()); } }
public T fromResourceLimit(ResourceLimit in) { return this .account(in.getAccount()) .domain(in.getDomain()) .domainId(in.getDomainId()) .max(in.getMax()) .resourceType(in.getResourceType()); } }