use of retrofit2.http.GET in project azure-sdk-for-java by Azure.
the class GroupsInner method getMemberGroupsWithServiceResponseAsync.
/**
* Gets a collection of object IDs of groups of which the specified group is a member.
*
* @param objectId The object ID of the group for which to get group membership.
* @param securityEnabledOnly If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<String> object
*/
public Observable<ServiceResponse<List<String>>> getMemberGroupsWithServiceResponseAsync(String objectId, boolean securityEnabledOnly) {
if (objectId == null) {
throw new IllegalArgumentException("Parameter objectId is required and cannot be null.");
}
if (this.client.tenantID() == null) {
throw new IllegalArgumentException("Parameter this.client.tenantID() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
GroupGetMemberGroupsParameters parameters = new GroupGetMemberGroupsParameters();
parameters.withSecurityEnabledOnly(securityEnabledOnly);
return service.getMemberGroups(objectId, this.client.tenantID(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<String>>>>() {
@Override
public Observable<ServiceResponse<List<String>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<String>> result = getMemberGroupsDelegate(response);
ServiceResponse<List<String>> clientResponse = new ServiceResponse<List<String>>(result.body().items(), result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of retrofit2.http.GET in project retrofit by square.
the class RequestBuilderAndroidTest method getWithAndroidUriUrlAbsolute.
@Test
public void getWithAndroidUriUrlAbsolute() {
class Example {
@GET
Call<ResponseBody> method(@Url Uri url) {
return null;
}
}
Request request = buildRequest(Example.class, Uri.parse("https://example2.com/foo/bar/"));
assertThat(request.method()).isEqualTo("GET");
assertThat(request.headers().size()).isZero();
assertThat(request.url().toString()).isEqualTo("https://example2.com/foo/bar/");
assertThat(request.body()).isNull();
}
use of retrofit2.http.GET in project retrofit by square.
the class RequestBuilderAndroidTest method getWithAndroidUriUrl.
@Test
public void getWithAndroidUriUrl() {
class Example {
@GET
Call<ResponseBody> method(@Url Uri url) {
return null;
}
}
Request request = buildRequest(Example.class, Uri.parse("foo/bar/"));
assertThat(request.method()).isEqualTo("GET");
assertThat(request.headers().size()).isZero();
assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/");
assertThat(request.body()).isNull();
}
use of retrofit2.http.GET in project retrofit by square.
the class RequestBuilderTest method getWithStringUrl.
@Test
public void getWithStringUrl() {
class Example {
@GET
Call<ResponseBody> method(@Url String url) {
return null;
}
}
Request request = buildRequest(Example.class, "foo/bar/");
assertThat(request.method()).isEqualTo("GET");
assertThat(request.headers().size()).isZero();
assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/");
assertThat(request.body()).isNull();
}
use of retrofit2.http.GET in project retrofit by square.
the class RequestBuilderTest method getWithJavaUriUrlAbsolute.
@Test
public void getWithJavaUriUrlAbsolute() {
class Example {
@GET
Call<ResponseBody> method(@Url URI url) {
return null;
}
}
Request request = buildRequest(Example.class, URI.create("https://example2.com/foo/bar/"));
assertThat(request.method()).isEqualTo("GET");
assertThat(request.headers().size()).isZero();
assertThat(request.url().toString()).isEqualTo("https://example2.com/foo/bar/");
assertThat(request.body()).isNull();
}
Aggregations