类javax.ws.rs.core.GenericType源码实例Demo

下面列出了怎么用javax.ws.rs.core.GenericType的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: clouditor   文件: EngineAPIResourcesTest.java
@Test
void testGetAssets() {
  var service = engine.getService(AssetService.class);

  var asset = new Asset("ASSET_TYPE", "some-id", "some-name", new AssetProperties());

  service.update(asset);

  var assets =
      target("assets")
          .path(ASSET_TYPE)
          .request()
          .header(
              AuthenticationFilter.HEADER_AUTHORIZATION,
              AuthenticationFilter.createAuthorization(this.token))
          .get(new GenericType<Set<Asset>>() {});

  assertNotNull(assets);
  assertFalse(assets.isEmpty());
}
 
源代码2 项目: clouditor   文件: EngineAPIResourcesTest.java
@Test
void testRules() throws IOException {
  var service = engine.getService(RuleService.class);

  service.load(FileSystemManager.getInstance().getPathForResource("rules/test"));

  var rules =
      target("rules")
          .request()
          .header(
              AuthenticationFilter.HEADER_AUTHORIZATION,
              AuthenticationFilter.createAuthorization(this.token))
          .get(new GenericType<Map<String, Set<Rule>>>() {});

  assertNotNull(rules);

  var rule = rules.get("Asset").toArray()[0];

  assertNotNull(rule);
}
 
源代码3 项目: judgels   文件: RabbitMQHealthCheck.java
@Override
protected Result check() throws Exception {
    String url = "http://" + config.getHost() + ":" + config.getManagementPort() + "/api/healthchecks/node";
    String creds = config.getUsername() + ":" + config.getPassword();
    String authHeader = "Basic " + Base64.getEncoder().encodeToString(creds.getBytes());

    Client client = new JerseyClientBuilder().build();

    Map<String, String> result = client
            .target(url)
            .request(APPLICATION_JSON)
            .header(AUTHORIZATION, authHeader)
            .get()
            .readEntity(new GenericType<HashMap<String, String>>() {});

    if (result.get("status").equals("ok")) {
        return Result.healthy();
    } else {
        return Result.unhealthy(result.get("reason"));
    }
}
 
源代码4 项目: choerodon-starters   文件: EventsApi.java
/**
 * Get a list of events for the specified user and in the specified page range.
 * <p>
 * GET /users/:userId/events
 *
 * @param userId     the user ID to get the events for, required
 * @param action     include only events of a particular action type, optional
 * @param targetType include only events of a particular target type, optional
 * @param before     include only events created before a particular date, optional
 * @param after      include only events created after a particular date, optional
 * @param sortOrder  sort events in ASC or DESC order by created_at. Default is DESC, optional
 * @param page       the page to get
 * @param perPage    the number of projects per page
 * @return a list of events for the specified user and matching the supplied parameters
 * @throws GitLabApiException if any exception occurs
 */
public List<Event> getUserEvents(Integer userId, ActionType action, TargetType targetType,
                                 Date before, Date after, SortOrder sortOrder, int page, int perPage) throws GitLabApiException {

    if (userId == null) {
        throw new RuntimeException("user ID cannot be null");
    }

    GitLabApiForm formData = new GitLabApiForm()
            .withParam("action", action)
            .withParam("target_type", targetType)
            .withParam("before", before)
            .withParam("after", after)
            .withParam("sort", sortOrder)
            .withParam(PAGE_PARAM, page)
            .withParam(PER_PAGE_PARAM, perPage);

    Response response = get(Response.Status.OK, formData.asMap(), "users", userId, "events");
    return (response.readEntity(new GenericType<List<Event>>() {
    }));
}
 
源代码5 项目: usergrid   文件: NamedResource.java
public <T> T post(boolean useToken, Token tokenToUse , Class<T> type, Map entity,
                  final QueryParameters queryParameters, boolean useBasicAuthentication) {

    WebTarget resource = getTarget( useToken,tokenToUse );
    resource = addParametersToResource(resource, queryParameters);

    GenericType<T> gt = new GenericType<>((Class) type);

    if (useBasicAuthentication) {
        HttpAuthenticationFeature feature = HttpAuthenticationFeature.basicBuilder()
            .credentials("superuser", "superpassword").build();
        return resource.register(feature).request()
                       .accept(MediaType.APPLICATION_JSON)
                       .post(javax.ws.rs.client.Entity.json(entity), gt);
    }

    return resource.request()
                   .accept(MediaType.APPLICATION_JSON)
                   .post(javax.ws.rs.client.Entity.json(entity), gt);
}
 
源代码6 项目: gitlab4j-api   文件: CommitsApi.java
/**
 * Get a list of repository commit statuses that meet the provided filter.
 *
 * <pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha/statuses</code></pre>
 *
 * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
 * @param sha the commit SHA
 * @param filter the commit statuses file, contains ref, stage, name, all
 * @param page the page to get
 * @param perPage the number of commits statuses per page
 * @return a List containing the commit statuses for the specified project and sha that meet the provided filter
 * @throws GitLabApiException GitLabApiException if any exception occurs during execution
 */
public List<CommitStatus> getCommitStatuses(Object projectIdOrPath, String sha,
        CommitStatusFilter filter, int page, int perPage) throws GitLabApiException {

    if (projectIdOrPath == null) {
        throw new RuntimeException("projectIdOrPath cannot be null");
    }

    if (sha == null || sha.trim().isEmpty()) {
        throw new RuntimeException("sha cannot be null");
    }

    MultivaluedMap<String, String> queryParams = (filter != null ?
            filter.getQueryParams(page, perPage).asMap() : getPageQueryParams(page, perPage));
    Response response = get(Response.Status.OK, queryParams, 
            "projects", this.getProjectIdOrPath(projectIdOrPath), "repository", "commits", sha, "statuses");
    return (response.readEntity(new GenericType<List<CommitStatus>>() {}));
}
 
源代码7 项目: cyberduck   文件: DownloadApi.java
/**
 * Get one time download id for zipped images (media)
 * 
 * @param request The download request (required)
 * @return ApiResponse&lt;String&gt;
 * @throws ApiException if fails to make API call
 */
public ApiResponse<String> downloadGetDownloadMediaToken_0WithHttpInfo(DownloadRequest request) throws ApiException {
  Object localVarPostBody = request;
  
  // verify the required parameter 'request' is set
  if (request == null) {
    throw new ApiException(400, "Missing the required parameter 'request' when calling downloadGetDownloadMediaToken_0");
  }
  
  // create path and map variables
  String localVarPath = "/v4/download/media";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();


  
  
  final String[] localVarAccepts = {
    "application/json", "text/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json", "text/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<String> localVarReturnType = new GenericType<String>() {};
  return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
源代码8 项目: TranskribusCore   文件: ModelUtil.java
public static GenericType createGenericType(String type) {
	if (StringUtils.isEmpty(type)) {
		throw new IllegalArgumentException("Type cannot be empty!");
	}
	
	switch (type) {
	case TrpP2PaLA.TYPE:
		return new GenericType<List<TrpP2PaLA>>(){};
	default:
		throw new IllegalArgumentException("Invalid type: "+type);
	}
}
 
源代码9 项目: syncope   文件: GroupRestClient.java
public ProvisioningResult<GroupTO> update(final String etag, final GroupUR updateReq) {
    ProvisioningResult<GroupTO> result;
    synchronized (this) {
        result = getService(etag, GroupService.class).update(updateReq).
                readEntity(new GenericType<ProvisioningResult<GroupTO>>() {
                });
        resetClient(getAnyServiceClass());
    }
    return result;
}
 
源代码10 项目: connect-java-sdk   文件: PaymentsApi.java
/**
 * ListPayments
 * Retrieves a list of payments taken by the account making the request.  Max results per page: 100
 * @param beginTime Timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive. Default: The current time minus one year. (optional)
 * @param endTime Timestamp for the end of the requested reporting period, in RFC 3339 format.  Default: The current time. (optional)
 * @param sortOrder The order in which results are listed. - &#x60;ASC&#x60; - oldest to newest - &#x60;DESC&#x60; - newest to oldest (default). (optional)
 * @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.  See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. (optional)
 * @param locationId ID of location associated with payment (optional)
 * @param total The exact amount in the total_money for a &#x60;Payment&#x60;. (optional)
 * @param last4 The last 4 digits of &#x60;Payment&#x60; card. (optional)
 * @param cardBrand The brand of &#x60;Payment&#x60; card. For example, &#x60;VISA&#x60; (optional)
 * @return ListPaymentsResponse
 * @throws ApiException if fails to make API call
 */
public ListPaymentsResponse listPayments(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand) throws ApiException {
  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/v2/payments";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "begin_time", beginTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_time", endTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_order", sortOrder));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "location_id", locationId));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "total", total));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "last_4", last4));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "card_brand", cardBrand));

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<ListPaymentsResponse> localVarReturnType = new GenericType<ListPaymentsResponse>() {};
  CompleteResponse<ListPaymentsResponse> completeResponse = (CompleteResponse<ListPaymentsResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  return completeResponse.getData();
    }
 
源代码11 项目: sofa-registry   文件: SessionDigestResourceTest.java
@Test
public void testGetSessionDataByDataInfoId() throws Exception {
    Map<String, List<Publisher>> publisherMap = sessionChannel
        .getWebTarget()
        .path("digest/pub/data/query")
        .queryParam("dataInfoId",
            DataInfo.toDataInfoId(dataId, DEFAULT_INSTANCE_ID, DEFAULT_GROUP))
        .request(APPLICATION_JSON).get(new GenericType<Map<String, List<Publisher>>>() {
        });
    assertEquals(1, publisherMap.size());
    assertEquals(1, publisherMap.get("PUB").size());
    assertEquals(dataId, publisherMap.get("PUB").get(0).getDataId());
    assertEquals(value, bytes2Object(publisherMap.get("PUB").get(0).getDataList().get(0)
        .getBytes()));

    Map<String, List<Subscriber>> subscriberMap = sessionChannel
        .getWebTarget()
        .path("digest/sub/data/query")
        .queryParam("dataInfoId",
            DataInfo.toDataInfoId(dataId, DEFAULT_INSTANCE_ID, DEFAULT_GROUP))
        .request(APPLICATION_JSON).get(new GenericType<Map<String, List<Subscriber>>>() {
        });
    assertEquals(1, subscriberMap.size());
    assertEquals(1, subscriberMap.get("SUB").size());
    assertEquals(dataId, subscriberMap.get("SUB").get(0).getDataId());

    Map map = sessionChannel
        .getWebTarget()
        .path("digest/all/data/query")
        .queryParam("dataInfoId",
            DataInfo.toDataInfoId(dataId, DEFAULT_INSTANCE_ID, DEFAULT_GROUP))
        .request(APPLICATION_JSON).get(Map.class);
    assertEquals(2, map.size());
    assertEquals(1, ((List) map.get("SUB")).size());
    assertEquals(1, ((List) map.get("PUB")).size());
    assertEquals(dataId, ((Map) ((List) map.get("SUB")).get(0)).get("dataId"));
    assertEquals(dataId, ((Map) ((List) map.get("PUB")).get(0)).get("dataId"));
    assertEquals(value, bytes2Object(publisherMap.get("PUB").get(0).getDataList().get(0)
        .getBytes()));
}
 
源代码12 项目: connect-java-sdk   文件: CatalogApi.java
/**
 * RetrieveCatalogObject
 * Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
 * @param objectId The object ID of any type of catalog objects to be retrieved. (required)
 * @param includeRelatedObjects If &#x60;true&#x60;, the response will include additional objects that are related to the requested object, as follows:  If the &#x60;object&#x60; field of the response contains a CatalogItem, its associated CatalogCategory, CatalogTax objects, CatalogImages and CatalogModifierLists will be returned in the &#x60;related_objects&#x60; field of the response. If the &#x60;object&#x60; field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the &#x60;related_objects&#x60; field of the response.  Default value: &#x60;false&#x60; (optional)
 * @return CompleteResponse<RetrieveCatalogObjectResponse>
 * @throws ApiException if fails to make API call
 */
public CompleteResponse<RetrieveCatalogObjectResponse>retrieveCatalogObjectWithHttpInfo(String objectId, Boolean includeRelatedObjects) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'objectId' is set
  if (objectId == null) {
    throw new ApiException(400, "Missing the required parameter 'objectId' when calling retrieveCatalogObject");
  }
  
  // create path and map variables
  String localVarPath = "/v2/catalog/object/{object_id}"
    .replaceAll("\\{" + "object_id" + "\\}", apiClient.escapeString(objectId.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_related_objects", includeRelatedObjects));

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<RetrieveCatalogObjectResponse> localVarReturnType = new GenericType<RetrieveCatalogObjectResponse>() {};
  return (CompleteResponse<RetrieveCatalogObjectResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
@Test
void action() { // the mock returns its input to allow is to test input is deciphered
    final Map<String, String> decrypted = base()
            .path("api/v1/action/execute")
            .queryParam("family", "testf")
            .queryParam("type", "testt")
            .queryParam("action", "testa")
            .queryParam("lang", "testl")
            .request(APPLICATION_JSON_TYPE)
            .header("x-talend-tenant-id", "test-tenant")
            .post(entity(new HashMap<String, String>() {

                {
                    put("configuration.username", "simple");
                    put("configuration.password", "vault:v1:hcccVPODe9oZpcr/sKam8GUrbacji8VkuDRGfuDt7bg7VA==");
                }
            }, APPLICATION_JSON_TYPE), new GenericType<Map<String, String>>() {
            });
    assertEquals(new HashMap<String, String>() {

        {
            // original value (not ciphered)
            put("configuration.username", "simple");
            // deciphered value
            put("configuration.password", "test");
            // action input config
            put("family", "testf");
            put("type", "testt");
            put("action", "testa");
            put("lang", "testl");
        }
    }, decrypted);
}
 
源代码14 项目: cyberduck   文件: SystemAuthConfigApi.java
/**
 * Create OpenID Connect IDP configuration
 * ### Functional Description: Create new OpenID Connect IDP configuration.  ### Precondition: Right _\&quot;change global config\&quot;_ required.   Role _Config Manager_ of the Provider Customer.  ### Effects: New OpenID Connect IDP configuration is created.  ### &amp;#9432; Further Information: See [http://openid.net/developers/specs](http://openid.net/developers/specs) for further information.
 *
 * @param body          body (required)
 * @param xSdsAuthToken Authentication token (optional)
 * @return ApiResponse&lt;OpenIdIdpConfig&gt;
 * @throws ApiException if fails to make API call
 */
public ApiResponse<OpenIdIdpConfig> createOpenIdIdpConfigWithHttpInfo(CreateOpenIdIdpConfigRequest body, String xSdsAuthToken) throws ApiException {
    Object localVarPostBody = body;

    // verify the required parameter 'body' is set
    if(body == null) {
        throw new ApiException(400, "Missing the required parameter 'body' when calling createOpenIdIdpConfig");
    }

    // create path and map variables
    String localVarPath = "/v4/system/config/auth/openid/idps";

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();


    if(xSdsAuthToken != null) {
        localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));
    }


    final String[] localVarAccepts = {
        "application/json;charset=UTF-8"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
        "application/json;charset=UTF-8"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[]{"DRACOON-OAuth"};

    GenericType<OpenIdIdpConfig> localVarReturnType = new GenericType<OpenIdIdpConfig>() {
    };
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
 
源代码15 项目: datacollector   文件: TestStageLibraryResource.java
@Test
@SuppressWarnings("unchecked")
public void testGetAllModules() {

  Response response = target("/v1/definitions").request().get();
  Map<String, Object> definitions = response.readEntity(new GenericType<Map<String, Object>>() {});

  //check the pipeline definition
  Assert.assertTrue(definitions.containsKey(StageLibraryResource.PIPELINE));
  List<Object> pipelineDefinition = (List<Object>)definitions.get(StageLibraryResource.PIPELINE);
  Assert.assertNotNull(pipelineDefinition);
  Assert.assertTrue(pipelineDefinition.size() == 1);

  //check the stages
  Assert.assertTrue(definitions.containsKey(StageLibraryResource.STAGES));
  List<Object> stages = (List<Object>)definitions.get(StageLibraryResource.STAGES);
  Assert.assertNotNull(stages);
  Assert.assertEquals(2, stages.size());

  //check the rules El metadata
  Assert.assertTrue(definitions.containsKey(StageLibraryResource.RULES_EL_METADATA));
  Map<String, Map> rulesElMetadata = (Map<String, Map>)definitions.get(StageLibraryResource.RULES_EL_METADATA);
  Assert.assertNotNull(rulesElMetadata);
  Assert.assertTrue(rulesElMetadata.containsKey(RuleELRegistry.GENERAL));
  Assert.assertTrue(rulesElMetadata.containsKey(RuleELRegistry.DRIFT));
  Assert.assertTrue(rulesElMetadata.get(RuleELRegistry.GENERAL).containsKey(StageLibraryResource.EL_FUNCTION_DEFS));
  Assert.assertTrue(rulesElMetadata.get(RuleELRegistry.GENERAL).containsKey(StageLibraryResource.EL_CONSTANT_DEFS));
  Assert.assertTrue(rulesElMetadata.get(RuleELRegistry.DRIFT).containsKey(StageLibraryResource.EL_FUNCTION_DEFS));
  Assert.assertTrue(rulesElMetadata.get(RuleELRegistry.DRIFT).containsKey(StageLibraryResource.EL_CONSTANT_DEFS));
}
 
源代码16 项目: openapi-generator   文件: StoreApi.java
/**
 * Place an order for a pet
 * 
 * @param order order placed for purchasing the pet (required)
 * @return ApiResponse&lt;Order&gt;
 * @throws ApiException if fails to make API call
 * @http.response.details
   <table summary="Response Details" border="1">
     <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
     <tr><td> 200 </td><td> successful operation </td><td>  -  </td></tr>
     <tr><td> 400 </td><td> Invalid Order </td><td>  -  </td></tr>
   </table>
 */
public ApiResponse<Order> placeOrderWithHttpInfo(Order order) throws ApiException {
  Object localVarPostBody = order;
  
  // verify the required parameter 'order' is set
  if (order == null) {
    throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder");
  }
  
  // create path and map variables
  String localVarPath = "/store/order";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, String> localVarCookieParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();


  
  
  
  final String[] localVarAccepts = {
    "application/xml", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] {  };

  GenericType<Order> localVarReturnType = new GenericType<Order>() {};

  return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody,
                             localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
                             localVarAuthNames, localVarReturnType, false);
}
 
源代码17 项目: training   文件: WeatherEndpointTest.java
@Test
public void getAllAirportIataCodes() {
	Response response = collect.path("/airports").request().get();
	List<String> airportCodes = response.readEntity(new GenericType<List<String>>(){});
	assertThat(airportCodes, hasItem("BOS"));
	assertEquals(5, airportCodes.size());
}
 
源代码18 项目: cxf   文件: ReactorInvokerImpl.java
private <R> Iterable<R> toIterable(Future<Response> futureResponse, Class<R> type) {
    try {
        Response response = futureResponse.get();
        GenericType<List<R>> rGenericType = new GenericType<>(new WrappedType<R>(type));
        return response.readEntity(rGenericType);
    } catch (InterruptedException | ExecutionException e) {
        throw new CompletionException(e);
    }
}
 
源代码19 项目: connect-java-sdk   文件: PaymentsApi.java
/**
 * ListPayments
 * Retrieves a list of payments taken by the account making the request.  Max results per page: 100
 * @param beginTime Timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive. Default: The current time minus one year. (optional)
 * @param endTime Timestamp for the end of the requested reporting period, in RFC 3339 format.  Default: The current time. (optional)
 * @param sortOrder The order in which results are listed. - &#x60;ASC&#x60; - oldest to newest - &#x60;DESC&#x60; - newest to oldest (default). (optional)
 * @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.  See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. (optional)
 * @param locationId ID of location associated with payment (optional)
 * @param total The exact amount in the total_money for a &#x60;Payment&#x60;. (optional)
 * @param last4 The last 4 digits of &#x60;Payment&#x60; card. (optional)
 * @param cardBrand The brand of &#x60;Payment&#x60; card. For example, &#x60;VISA&#x60; (optional)
 * @return CompleteResponse<ListPaymentsResponse>
 * @throws ApiException if fails to make API call
 */
public CompleteResponse<ListPaymentsResponse>listPaymentsWithHttpInfo(String beginTime, String endTime, String sortOrder, String cursor, String locationId, Long total, String last4, String cardBrand) throws ApiException {
  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/v2/payments";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "begin_time", beginTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_time", endTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_order", sortOrder));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "location_id", locationId));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "total", total));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "last_4", last4));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "card_brand", cardBrand));

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<ListPaymentsResponse> localVarReturnType = new GenericType<ListPaymentsResponse>() {};
  return (CompleteResponse<ListPaymentsResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
源代码20 项目: connect-java-sdk   文件: CatalogApi.java
/**
 * BatchDeleteCatalogObjects
 * Deletes a set of [CatalogItem](#type-catalogitem)s based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children.  &#x60;BatchDeleteCatalogObjects&#x60; succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.
 * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
 * @return BatchDeleteCatalogObjectsResponse
 * @throws ApiException if fails to make API call
 */
public BatchDeleteCatalogObjectsResponse batchDeleteCatalogObjects(BatchDeleteCatalogObjectsRequest body) throws ApiException {
  Object localVarPostBody = body;
  
  // verify the required parameter 'body' is set
  if (body == null) {
    throw new ApiException(400, "Missing the required parameter 'body' when calling batchDeleteCatalogObjects");
  }
  
  // create path and map variables
  String localVarPath = "/v2/catalog/batch-delete";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<BatchDeleteCatalogObjectsResponse> localVarReturnType = new GenericType<BatchDeleteCatalogObjectsResponse>() {};
  CompleteResponse<BatchDeleteCatalogObjectsResponse> completeResponse = (CompleteResponse<BatchDeleteCatalogObjectsResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  return completeResponse.getData();
    }
 
源代码21 项目: cyberduck   文件: FileSharesApi.java
/**
 * Return a FileShare with share information and file.
 * 
 * @param id The file id (required)
 * @return ApiResponse&lt;FileShare&gt;
 * @throws ApiException if fails to make API call
 */
public ApiResponse<FileShare> fileSharesGetByFileIdWithHttpInfo(String id) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'id' is set
  if (id == null) {
    throw new ApiException(400, "Missing the required parameter 'id' when calling fileSharesGetByFileId");
  }
  
  // create path and map variables
  String localVarPath = "/v4/fileshares/fileid/{id}"
    .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();


  
  
  final String[] localVarAccepts = {
    "application/json", "text/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<FileShare> localVarReturnType = new GenericType<FileShare>() {};
  return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
源代码22 项目: cyberduck   文件: SystemAuthConfigApi.java
/**
 * Get Active Directory configuration
 * ### Functional Description:   Retrieve the configuration of an Active Directory.  ### Precondition: Right _\&quot;read global config\&quot;_ required.   Role _Config Manager_ of the Provider Customer.  ### Effects: None.  ### &amp;#9432; Further Information: None.
 *
 * @param adId          Active Directory ID (required)
 * @param xSdsAuthToken Authentication token (optional)
 * @return ApiResponse&lt;ActiveDirectoryConfig&gt;
 * @throws ApiException if fails to make API call
 */
public ApiResponse<ActiveDirectoryConfig> getAuthAdSettingWithHttpInfo(Integer adId, String xSdsAuthToken) throws ApiException {
    Object localVarPostBody = null;

    // verify the required parameter 'adId' is set
    if(adId == null) {
        throw new ApiException(400, "Missing the required parameter 'adId' when calling getAuthAdSetting");
    }

    // create path and map variables
    String localVarPath = "/v4/system/config/auth/ads/{ad_id}"
        .replaceAll("\\{" + "ad_id" + "\\}", apiClient.escapeString(adId.toString()));

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();


    if(xSdsAuthToken != null) {
        localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));
    }


    final String[] localVarAccepts = {
        "application/json;charset=UTF-8"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {

    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[]{"DRACOON-OAuth"};

    GenericType<ActiveDirectoryConfig> localVarReturnType = new GenericType<ActiveDirectoryConfig>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
 
源代码23 项目: connect-java-sdk   文件: CatalogApi.java
/**
 * BatchDeleteCatalogObjects
 * Deletes a set of [CatalogItem](#type-catalogitem)s based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children.  &#x60;BatchDeleteCatalogObjects&#x60; succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.
 * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
 * @return CompleteResponse<BatchDeleteCatalogObjectsResponse>
 * @throws ApiException if fails to make API call
 */
public CompleteResponse<BatchDeleteCatalogObjectsResponse>batchDeleteCatalogObjectsWithHttpInfo(BatchDeleteCatalogObjectsRequest body) throws ApiException {
  Object localVarPostBody = body;
  
  // verify the required parameter 'body' is set
  if (body == null) {
    throw new ApiException(400, "Missing the required parameter 'body' when calling batchDeleteCatalogObjects");
  }
  
  // create path and map variables
  String localVarPath = "/v2/catalog/batch-delete";

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<BatchDeleteCatalogObjectsResponse> localVarReturnType = new GenericType<BatchDeleteCatalogObjectsResponse>() {};
  return (CompleteResponse<BatchDeleteCatalogObjectsResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
源代码24 项目: cyberduck   文件: EventlogApi.java
/**
     * Get node assigned users with permissions
     * ### &amp;#128640; Since version 4.3.0  ### Functional Description:   Retrieve a list of all nodes of type &#x60;room&#x60;, and the room assignment users with permissions.  ### Precondition: Right _\&quot;read audit log\&quot;_ required.  ### Effects: None.  ### &amp;#9432; Further Information: None.  ### Filtering ### &amp;#9888; All filter fields are connected via logical conjunction (**AND**) ### &amp;#9888; Except for **&#x60;userName&#x60;**, **&#x60;userFirstName&#x60;** and  **&#x60;userLastName&#x60;** - these are connected via logical disjunction (**OR**) Filter string syntax: &#x60;FIELD_NAME:OPERATOR:VALUE[:VALUE...]&#x60;    Example: &gt; &#x60;userName:cn:searchString_1|userFirstName:cn:searchString_2|nodeId:eq:2&#x60;   Filter by user login containing &#x60;searchString_1&#x60; **OR** first name containing &#x60;searchString_2&#x60; **AND** node ID equals &#x60;2&#x60;.  | &#x60;FIELD_NAME&#x60; | Filter Description | &#x60;OPERATOR&#x60; | Operator Description | &#x60;VALUE&#x60; | | :--- | :--- | :--- | :--- | :--- | | **&#x60;nodeId&#x60;** | Node ID filter | &#x60;eq&#x60; | Node ID equals value. | &#x60;positive Integer&#x60; | | **&#x60;nodeName&#x60;** | Node name filter | &#x60;cn, eq&#x60; | Node name contains / equals value. | &#x60;search String&#x60; | | **&#x60;nodeParentId&#x60;** | Node parent ID filter | &#x60;eq&#x60; | Parent ID equals value. | &#x60;positive Integer&#x60;&lt;br&gt;Parent ID &#x60;0&#x60; is the root node. | | **&#x60;userId&#x60;** | User ID filter | &#x60;eq&#x60; | User ID equals value. | &#x60;positive Integer&#x60; | | **&#x60;userName&#x60;** | Username (login) filter | &#x60;cn, eq&#x60; | Username contains / equals value. | &#x60;search String&#x60; | | **&#x60;userFirstName&#x60;** | User first name filter | &#x60;cn, eq&#x60; | User first name contains / equals value. | &#x60;search String&#x60; | | **&#x60;userLastName&#x60;** | User last name filter | &#x60;cn, eq&#x60; | User last name contains / equals value. | &#x60;search String&#x60; | | **&#x60;permissionsManage&#x60;** | Filter the users that do (not) have &#x60;manage&#x60; permissions in this room | &#x60;eq&#x60; |  | &#x60;true or false&#x60; | | **&#x60;nodeIsEncrypted&#x60;** | Encrypted node filter | &#x60;eq&#x60; |  | &#x60;true or false&#x60; | | **&#x60;nodeHasActivitiesLog&#x60;** | Activities log filter | &#x60;eq&#x60; |  | &#x60;true or false&#x60; | | **&#x60;nodeHasRecycleBin&#x60;** | (**&#x60;DEPRECATED&#x60;**)&lt;br&gt;Recycle bin filter&lt;br&gt;**Filter has no effect!** | &#x60;eq&#x60; |  | &#x60;true or false&#x60; |  ### Sorting Sort string syntax: &#x60;FIELD_NAME:ORDER&#x60;   &#x60;ORDER&#x60; can be &#x60;asc&#x60; or &#x60;desc&#x60;.   Multiple sort fields are supported.   Example: &gt; &#x60;nodeName:asc&#x60;   Sort by &#x60;nodeName&#x60; ascending.  | &#x60;FIELD_NAME&#x60; | Description | | :--- | :--- | | **&#x60;nodeId&#x60;** | Node ID | | **&#x60;nodeName&#x60;** | Node name | | **&#x60;nodeParentId&#x60;** | Node parent ID | | **&#x60;nodeSize&#x60;** | Node size | | **&#x60;nodeQuota&#x60;** | Node quota |
     *
     * @param xSdsAuthToken  Authentication token (optional)
     * @param xSdsDateFormat Date time format (cf. [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) &amp; [leettime.de](http://leettime.de/)) (optional)
     * @param filter         Filter string (optional)
     * @param limit          Range limit. Maximum 500.   For more results please use paging (&#x60;offset&#x60; + &#x60;limit&#x60;). (optional)
     * @param offset         Range offset (optional)
     * @param sort           Sort string (optional)
     * @return ApiResponse&lt;List&lt;AuditNodeResponse&gt;&gt;
     * @throws ApiException if fails to make API call
     */
    public ApiResponse<List<AuditNodeResponse>> getAuditNodeUserDataWithHttpInfo(String xSdsAuthToken, String xSdsDateFormat, String filter, Integer limit, Integer offset, String sort) throws ApiException {
    Object localVarPostBody = null;
    
    // create path and map variables
    String localVarPath = "/v4/eventlog/audits/nodes";

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();

    localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
        localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));

    if (xSdsAuthToken != null)
      localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));
if (xSdsDateFormat != null)
      localVarHeaderParams.put("X-Sds-Date-Format", apiClient.parameterToString(xSdsDateFormat));

    
    final String[] localVarAccepts = {
      "application/json;charset=UTF-8"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "DRACOON-OAuth" };

    GenericType<List<AuditNodeResponse>> localVarReturnType = new GenericType<List<AuditNodeResponse>>() {};
    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
源代码25 项目: connect-java-sdk   文件: TransactionsApi.java
/**
 * ListRefunds
 * Lists refunds for one of a business&#39;s locations.  Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders)  In addition to full or partial tender refunds processed through Square APIs, refunds may result from itemized returns or exchanges through Square&#39;s Point of Sale applications.  Refunds with a &#x60;status&#x60; of &#x60;PENDING&#x60; are not currently included in this endpoint&#39;s response.  Max results per [page](#paginatingresults): 50
 * @param locationId The ID of the location to list refunds for. (required)
 * @param beginTime The beginning of the requested reporting period, in RFC 3339 format.  See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.  Default value: The current time minus one year. (optional)
 * @param endTime The end of the requested reporting period, in RFC 3339 format.  See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.  Default value: The current time. (optional)
 * @param sortOrder The order in which results are listed in the response (&#x60;ASC&#x60; for oldest first, &#x60;DESC&#x60; for newest first).  Default value: &#x60;DESC&#x60; (optional)
 * @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query.  See [Paginating results](#paginatingresults) for more information. (optional)
 * @return CompleteResponse<ListRefundsResponse>
 * @throws ApiException if fails to make API call
 */
public CompleteResponse<ListRefundsResponse>listRefundsWithHttpInfo(String locationId, String beginTime, String endTime, String sortOrder, String cursor) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'locationId' is set
  if (locationId == null) {
    throw new ApiException(400, "Missing the required parameter 'locationId' when calling listRefunds");
  }
  
  // create path and map variables
  String localVarPath = "/v2/locations/{location_id}/refunds"
    .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();
  localVarHeaderParams.put("Square-Version", "2019-11-20");
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "begin_time", beginTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_time", endTime));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_order", sortOrder));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));

  
  
  final String[] localVarAccepts = {
    "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    "application/json"
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<ListRefundsResponse> localVarReturnType = new GenericType<ListRefundsResponse>() {};
  return (CompleteResponse<ListRefundsResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
源代码26 项目: cyberduck   文件: UploadApi.java
/**
 * Upload a file to a share using a multipart request containing first a metadata (see reponse) part and a then the filedata part.              Use header \&quot;X-Lock-Id\&quot; to send lock id if needed
 * 
 * @param shareid The shareId (required)
 * @return ApiResponse&lt;ch.cyberduck.core.storegate.io.swagger.client.model.FileMetadata&gt;
 * @throws ApiException if fails to make API call
 */
public ApiResponse<ch.cyberduck.core.storegate.io.swagger.client.model.FileMetadata> uploadPostMultipartShareWithHttpInfo(String shareid) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'shareid' is set
  if (shareid == null) {
    throw new ApiException(400, "Missing the required parameter 'shareid' when calling uploadPostMultipartShare");
  }
  
  // create path and map variables
  String localVarPath = "/v4/upload/shares/{shareid}"
    .replaceAll("\\{" + "shareid" + "\\}", apiClient.escapeString(shareid.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();


  
  
  final String[] localVarAccepts = {
    "application/json", "text/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] { "oauth2" };

  GenericType<ch.cyberduck.core.storegate.io.swagger.client.model.FileMetadata> localVarReturnType = new GenericType<ch.cyberduck.core.storegate.io.swagger.client.model.FileMetadata>() {};
  return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
源代码27 项目: openapi-generator   文件: StoreApi.java
/**
 * Find purchase order by ID
 * For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
 * @param orderId ID of pet that needs to be fetched (required)
 * @return a {@code Order}
 * @throws ApiException if fails to make API call
 */
public Order getOrderById(Long orderId) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'orderId' is set
  if (orderId == null) {
    throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
  }
  
  // create path and map variables
  String localVarPath = "/store/order/{order_id}".replaceAll("\\{format\\}","json")
    .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  Map<String, String> localVarHeaderParams = new HashMap<String, String>();
  Map<String, String> localVarCookieParams = new HashMap<String, String>();
  Map<String, Object> localVarFormParams = new HashMap<String, Object>();


  
  
  
  final String[] localVarAccepts = {
    "application/xml", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

  final String[] localVarContentTypes = {
    
  };
  final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

  String[] localVarAuthNames = new String[] {  };

  GenericType<Order> localVarReturnType = new GenericType<Order>() {};
  return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
源代码28 项目: training   文件: WeatherEndpointTest.java
@Test
public void setAndGetDataPoint() {
	Response response = query.path("/weather/BOS/0").request().get();
    assertNull(response.readEntity(new GenericType<List<Weather>>(){})
    		.get(0).getWind());
	
    collect.path("/weather/BOS/wind").request()
    		.post(Entity.entity(windDataPoint, "application/json"));
    
    response = query.path("/weather/BOS/0").request().get();
    List<Weather> fromServer = response.readEntity(new GenericType<List<Weather>>(){});
    
    assertEquals(windDataPoint, fromServer.get(0).getWind());
}
 
源代码29 项目: brooklyn-server   文件: CatalogResourceTest.java
protected void runSetDeprecated(DeprecateStyle style) {
    String symbolicName = "my.catalog.item.id.for.deprecation";
    String serviceType = "org.apache.brooklyn.entity.stock.BasicApplication";
    addTestCatalogItem(symbolicName, "template", TEST_VERSION, serviceType);
    addTestCatalogItem(symbolicName, "template", "2.0", serviceType);
    try {
        List<CatalogEntitySummary> applications = client().path("/catalog/applications")
                .query("fragment", symbolicName).query("allVersions", "true").get(new GenericType<List<CatalogEntitySummary>>() {});
        assertEquals(applications.size(), 2);
        CatalogItemSummary summary0 = applications.get(0);
        CatalogItemSummary summary1 = applications.get(1);

        // Deprecate: that app should be excluded
        deprecateCatalogItem(style, summary0.getSymbolicName(), summary0.getVersion(), true);

        List<CatalogEntitySummary> applicationsAfterDeprecation = client().path("/catalog/applications")
                .query("fragment", "basicapp").query("allVersions", "true").get(new GenericType<List<CatalogEntitySummary>>() {});

        assertEquals(applicationsAfterDeprecation.size(), 1);
        assertTrue(applicationsAfterDeprecation.contains(summary1));

        // Un-deprecate: that app should be included again
        deprecateCatalogItem(style, summary0.getSymbolicName(), summary0.getVersion(), false);

        List<CatalogEntitySummary> applicationsAfterUnDeprecation = client().path("/catalog/applications")
                .query("fragment", "basicapp").query("allVersions", "true").get(new GenericType<List<CatalogEntitySummary>>() {});

        assertEquals(applications, applicationsAfterUnDeprecation);
    } finally {
        client().path("/catalog/entities/"+symbolicName+"/"+TEST_VERSION)
                .delete();
        client().path("/catalog/entities/"+symbolicName+"/"+"2.0")
                .delete();
    }
}
 
源代码30 项目: jersey-jwt   文件: UserResourceTest.java
@Test
public void getUsersAsAdmin() {

    String authorizationHeader = composeAuthorizationHeader(getTokenForAdmin());

    Response response = client.target(uri).path("api").path("users").request()
            .header(HttpHeaders.AUTHORIZATION, authorizationHeader).get();
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());

    List<QueryUserResult> queryDetailsList = response.readEntity(new GenericType<List<QueryUserResult>>() {});
    assertNotNull(queryDetailsList);
    assertThat(queryDetailsList, hasSize(3));
}