com.sun.jersey.api.client.GenericType Java Examples

The following examples show how to use com.sun.jersey.api.client.GenericType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClusterManagerTest.java    From herd-mdl with Apache License 2.0 6 votes vote down vote up
@Test
   public void testStartAdditionalClusterCreated() throws ApiException {
	ClusterManager clusterManager = new ClusterManager();
       clusterManager.setAgs("METASTOR");

       final String[] accepts = {"application/xml", "application/json"};

	String[] authNames = new String[] { "basicAuthentication" };

	ApiClient dmApiClient = Mockito.mock( ApiClient.class );

       clusterManager.setDmRestClient( dmApiClient );

	when( dmApiClient.selectHeaderAccept( accepts ) ).thenReturn( "application/json" );
	when( dmApiClient.selectHeaderContentType( accepts ) ).thenReturn( "application/json" );
	when( dmApiClient.invokeAPI( anyString(), anyString(), anyList(), anyList(), anyObject(), anyMap(), anyMap()
			, anyString(), anyString(), eq(authNames),any(GenericType.class) ) )
			.thenReturn( new EmrCluster() );

	List<String> existingCluster = new ArrayList<>();
	clusterManager.startAdditionalClusters( 1, existingCluster );

	assertEquals( 1, existingCluster.size());
	assertEquals( "METASTOR_1", existingCluster.get( 0 ) );
}
 
Example #2
Source File: DataStoreJerseyTest.java    From emodb with Apache License 2.0 6 votes vote down vote up
/** Test getTimeline() with timestamp start/end instead of UUIDs. */
@Test
public void testGetTimelineRESTTimestampsReversed() throws Exception {
    Date start = new Date();
    Date end = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse("2012-03-15 16:12:34.567");
    UUID startUuid = TimeUUIDs.getPrevious(TimeUUIDs.uuidForTimeMillis(start.getTime() + 1));
    UUID endUuid = TimeUUIDs.uuidForTimestamp(end);
    when(_server.getTimeline("table-name", "row-key", true, false, startUuid, endUuid, true, 10, ReadConsistency.STRONG))
            .thenReturn(Iterators.<Change>emptyIterator());

    DateTimeFormatter format = DateTimeFormatter.ISO_INSTANT;
    URI uri = UriBuilder.fromUri("/sor/1")
            .segment("table-name", "row-key", "timeline")
            .queryParam("start", format.format(start.toInstant()))
            .queryParam("end", format.format(end.toInstant()))
            .build();
    _resourceTestRule.client().resource(uri)
            .accept(MediaType.APPLICATION_JSON_TYPE)
            .header(ApiKeyRequest.AUTHENTICATION_HEADER, APIKEY_TABLE)
            .get(new GenericType<List<Change>>() {
            });

    verify(_server).getTimeline("table-name", "row-key", true, false, startUuid, endUuid, true, 10, ReadConsistency.STRONG);
    verifyNoMoreInteractions(_server);
}
 
Example #3
Source File: BucketsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * This endpoint will return the buckets owned by the application. This endpoint supports pagination. 
 * @param region The region where the bucket resides Acceptable values: &#x60;US&#x60;, &#x60;EMEA&#x60; Default is &#x60;US&#x60;  (optional, default to US)
 * @param limit Limit to the response size, Acceptable values: 1-100 Default &#x3D; 10  (optional, default to 10)
 * @param startAt Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response  (optional)
 * @return Buckets
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Buckets> getBuckets(String region, Integer limit, String startAt,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/oss/v2/buckets".replaceAll("\\{format\\}","json");

  // 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("", "region", region));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "startAt", startAt));

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

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

  GenericType<Buckets> localVarReturnType = new GenericType<Buckets>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #4
Source File: ProjectsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Creates a new version of an item in the &#39;data&#39; domain service.
 * @param projectId the &#x60;project id&#x60; (required)
 * @param hubId the &#x60;hub id&#x60; (required)
 * @return VersionCreated
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Folder> topFolders(String hubId, String projectId, Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;

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

  // create path and map variables
  String localVarPath = "/project/v1/hubs/{hub_id}/projects/{project_id}/hub"
          .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString()))
          .replaceAll("\\{" + "hub_id" + "\\}", apiClient.escapeString(hubId.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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Folder> localVarReturnType = new GenericType<Folder>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #5
Source File: ApiClient.java    From openapi-generator with Apache License 2.0 5 votes vote down vote up
/**
 * Invoke API by sending HTTP request with the given options.
 *
 * @param <T> Type
 * @param path The sub-path of the HTTP URL
 * @param method The request method, one of "GET", "POST", "PUT", and "DELETE"
 * @param queryParams The query parameters
 * @param collectionQueryParams The collection query parameters
 * @param body The request body object - if it is not binary, otherwise null
 * @param headerParams The header parameters
 * @param cookieParams The cookie parameters
 * @param formParams The form parameters
 * @param accept The request's Accept header
 * @param contentType The request's Content-Type header
 * @param authNames The authentications to apply
 * @param returnType Return type
 * @return The response body in type of string
 * @throws ApiException API exception
 */
 public <T> T invokeAPI(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {

  ClientResponse response = getAPIResponse(path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);

  statusCode = response.getStatusInfo().getStatusCode();
  responseHeaders = response.getHeaders();

  if(response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) {
    return null;
  } else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
    if (returnType == null)
      return null;
    else
      return response.getEntity(returnType);
  } else {
    String message = "error";
    String respBody = null;
    if (response.hasEntity()) {
      try {
        respBody = response.getEntity(String.class);
        message = respBody;
      } catch (RuntimeException e) {
        // e.printStackTrace();
      }
    }
    throw new ApiException(
      response.getStatusInfo().getStatusCode(),
      message,
      response.getHeaders(),
      respBody);
  }
}
 
Example #6
Source File: UserApi.java    From openapi-generator with Apache License 2.0 5 votes vote down vote up
/**
 * Get user by user name
 * 
 * @param username The name that needs to be fetched. Use user1 for testing. (required)
 * @return User
 * @throws ApiException if fails to make API call
 */
public User getUserByName(String username) throws ApiException {
  Object localVarPostBody = null;
  
  // verify the required parameter 'username' is set
  if (username == null) {
    throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
  }
  
  // create path and map variables
  String localVarPath = "/user/{username}"
    .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));

  // query params
  List<Pair> localVarQueryParams = new ArrayList<Pair>();
  List<Pair> localVarCollectionQueryParams = 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<User> localVarReturnType = new GenericType<User>() {};
  return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    }
 
Example #7
Source File: ItemsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * Creates a new item in the &#39;data&#39; domain service. 
 * @param projectId the &#x60;project id&#x60; (required)
 * @param body describe the item to be created (required)
 * @return ItemCreated
 * @throws ApiException if fails to make API call
 */
public ApiResponse<ItemCreated> postItem(String projectId, CreateItem body,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = body;
  
  // verify the required parameter 'projectId' is set
  if (projectId == null) {
    throw new ApiException(400, "Missing the required parameter 'projectId' when calling postItem");
  }
  
  // verify the required parameter 'body' is set
  if (body == null) {
    throw new ApiException(400, "Missing the required parameter 'body' when calling postItem");
  }
  
  // create path and map variables
  String localVarPath = "/data/v1/projects/{project_id}/items".replaceAll("\\{format\\}","json")
    .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<ItemCreated> localVarReturnType = new GenericType<ItemCreated>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #8
Source File: ProjectsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * Returns a collection of projects for a given &#x60;hub_id&#x60;. A project represents an A360 project or a BIM 360 project which is set up under an A360 hub or BIM 360 account, respectively. Within a hub or an account, multiple projects can be created to be used. 
 * @param hubId the &#x60;hub id&#x60; for the current operation (required)
 * @param filterId filter by the &#x60;id&#x60; of the &#x60;ref&#x60; target (optional)
 * @param filterExtensionType filter by the extension type (optional)
 * @return Projects
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Projects> getHubProjects(String hubId, List<String> filterId, List<String> filterExtensionType, Integer pageNumber, Integer pageLimit, Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'hubId' is set
  if (hubId == null) {
    throw new ApiException(400, "Missing the required parameter 'hubId' when calling getHubProjects");
  }
  
  // create path and map variables
  String localVarPath = "/project/v1/hubs/{hub_id}/projects".replaceAll("\\{format\\}","json")
    .replaceAll("\\{" + "hub_id" + "\\}", apiClient.escapeString(hubId.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>();

  localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "filter[id]", filterId));
  localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "filter[extension.type]", filterExtensionType));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
  
  
  final String[] localVarAccepts = {
    "application/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Projects> localVarReturnType = new GenericType<Projects>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #9
Source File: NotificationApi.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * This API is used to validate code of self reigstered users
 *
 * @param code Code retried after user self registration and optional property parameters (required)
 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
 */
public void validateCodePostCall(CodeValidationRequest code) throws ApiException {

    // verify the required parameter 'code' is set
    if (code == null) {
        throw new ApiException(400, "Missing the required parameter 'code' when calling validateCodePost(Async)");
    }
    final String[] contentType = {
            "application/json"
    };
    final String headerAccept = apiClient.selectHeaderAccept(contentType);
    String tenantDomain = getTenantDomain(code);

    basePath = IdentityManagementEndpointUtil.getBasePath(tenantDomain,
            IdentityManagementEndpointConstants.UserInfoRecovery.RECOVERY_API_RELATIVE_PATH);
    apiClient.setBasePath(basePath);

    Map<String, String> headerParams = new HashMap<>();
    if (headerAccept != null) {
        headerParams.put("Accept", headerAccept);
    }
    final String headerContentType = apiClient.selectHeaderContentType(contentType);
    headerParams.put("Content-Type", headerContentType);
    String[] authNames = new String[]{};
    GenericType<String> localVarReturnType = new GenericType<String>() {};
    // create path and map variables
    String path = "/validate-code".replaceAll("\\{format\\}", "json");
    List<Pair> queryParams = new ArrayList<>();
    Map<String, Object> formParams = new HashMap<>();
    apiClient.invokeAPI(path, "POST", queryParams, code, headerParams,
            formParams, headerAccept, headerContentType, authNames, localVarReturnType);
}
 
Example #10
Source File: WorkItemsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the details of all WorkItems.
 * 
 * @param skip  (optional)
 * @return DesignAutomationWorkItems
 * @throws ApiException if fails to make API call
 */
public ApiResponse<DesignAutomationWorkItems> getAllWorkItems(Integer skip,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/WorkItems".replaceAll("\\{format\\}","json");

  // 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("", "$skip", skip));

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

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

  GenericType<DesignAutomationWorkItems> localVarReturnType = new GenericType<DesignAutomationWorkItems>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #11
Source File: ReCaptchaApi.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * Return the reCaptchaGet details in the headers for the given tenant.
 *
 * @param tenantDomain          Tenant domain. Default &#x60;carbon.super&#x60; (optional).
 * @param isEndpointTenantAware Is tenant aware endpoint.
 * @param captchaType           Captcha type.
 * @param recoveryType          Recovery type.
 * @return Return captcha details as ReCaptchaProperties.
 * @throws ApiException if fails to make API call.
 */
public ReCaptchaProperties getReCaptcha(String tenantDomain, boolean isEndpointTenantAware, String captchaType,
                                        String recoveryType) throws ApiException {

    if (StringUtils.isBlank(tenantDomain)) {
        tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
    }

    basePath = IdentityManagementEndpointUtil.getBasePath(tenantDomain,
            IdentityManagementEndpointConstants.UserInfoRecovery.RECOVERY_API_RELATIVE_PATH, isEndpointTenantAware);
    apiClient.setBasePath(basePath);

    String localVarPath = "/captcha";

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

    localVarQueryParams.addAll(apiClient.parameterToPairs(StringUtils.EMPTY, TENANTDOMAIN, tenantDomain));
    localVarQueryParams.addAll(apiClient.parameterToPairs(StringUtils.EMPTY, CAPTCHA_TYPE, captchaType));
    localVarQueryParams.addAll(apiClient.parameterToPairs(StringUtils.EMPTY, RECOVERY_TYPE, recoveryType));

    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

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

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

    return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, null, localVarHeaderParams,
            localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
Example #12
Source File: ApiClient.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * Invoke API by sending HTTP request with the given options.
 *
 * @param path         The sub-path of the HTTP URL
 * @param method       The request method, one of "GET", "POST", "PUT", and "DELETE"
 * @param queryParams  The query parameters
 * @param body         The request body object - if it is not binary, otherwise null
 * @param headerParams The header parameters
 * @param formParams   The form parameters
 * @param accept       The request's Accept header
 * @param contentType  The request's Content-Type header
 * @param authNames    The authentications to apply
 * @return The response body in type of string
 */
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {

    ClientResponse response = getAPIResponse(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);

    statusCode = response.getStatusInfo().getStatusCode();
    responseHeaders = response.getHeaders();

    if (response.getStatusInfo().getStatusCode() == ClientResponse.Status.NO_CONTENT.getStatusCode()) {

        throw new ApiException(204, "No content Found");

    } else if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
        if (returnType == null) {
            return null;
        } else {
            return response.getEntity(returnType);
        }
    } else {
        String message = "error";
        String respBody = null;
        if (response.hasEntity()) {
            try {
                respBody = response.getEntity(String.class);
                message = respBody;
            } catch (RuntimeException e) {
                // e.printStackTrace();
            }
        }
        throw new ApiException(
                response.getStatusInfo().getStatusCode(),
                message,
                response.getHeaders(),
                respBody);
    }
}
 
Example #13
Source File: DatabusJerseyTest.java    From emodb with Apache License 2.0 5 votes vote down vote up
private void testPeek(boolean includeTags) {
    List<Event> peekResults = ImmutableList.of(
            new Event("id-1", ImmutableMap.of("key-1", "value-1"), ImmutableList.<List<String>>of(ImmutableList.<String>of("tag-1"))),
            new Event("id-2", ImmutableMap.of("key-2", "value-2"), ImmutableList.<List<String>>of(ImmutableList.<String>of("tag-2"))));
    when(_client.peek(isSubject(), eq("queue-name"), eq(123))).thenReturn(peekResults.iterator());

    List<Event> expected;
    List<Event> actual;

    if (includeTags) {
        // This is the default peek behavior
        expected = peekResults;
        actual = ImmutableList.copyOf(databusClient().peek("queue-name", 123));
    } else {
        // Tags won't be returned
        expected = ImmutableList.of(
                new Event("id-1", ImmutableMap.of("key-1", "value-1"), ImmutableList.<List<String>>of()),
                new Event("id-2", ImmutableMap.of("key-2", "value-2"), ImmutableList.<List<String>>of()));

        // Must make API call directly since only older databus clients don't automatically include tags
        // and the current databus client always does.
        actual = _resourceTestRule.client().resource("/bus/1/queue-name/peek")
                .queryParam("limit", "123")
                .accept(MediaType.APPLICATION_JSON_TYPE)
                .header(ApiKeyRequest.AUTHENTICATION_HEADER, APIKEY_DATABUS)
                .get(new GenericType<List<Event>>() {});
    }

    assertEquals(actual, expected);
    verify(_client).peek(isSubject(), eq("queue-name"), eq(123));
    verifyNoMoreInteractions(_local, _client);
}
 
Example #14
Source File: WorkItemsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the details of a specific WorkItem.
 * 
 * @param id  (required)
 * @return WorkItemResp
 * @throws ApiException if fails to make API call
 */
public ApiResponse<WorkItemResp> getWorkItem(String id,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'id' is set
  if (id == null) {
    throw new ApiException(400, "Missing the required parameter 'id' when calling getWorkItem");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/WorkItems('{id}')".replaceAll("\\{format\\}","json")
    .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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<WorkItemResp> localVarReturnType = new GenericType<WorkItemResp>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #15
Source File: DataStoreJerseyTest.java    From emodb with Apache License 2.0 5 votes vote down vote up
/** Test getTimeline(), omitting all optional query parameters. */
@Test
public void testGetTimelineRESTDefault() throws Exception {
    List<Change> expected = ImmutableList.of(
            new ChangeBuilder(TimeUUIDs.newUUID())
                    .with(Deltas.literal("hello world"))
                    .with(new Compaction(5, TimeUUIDs.newUUID(), TimeUUIDs.newUUID(), "1234567890abcdef", null, null))
                    .build());
    when(_server.getTimeline("table-name", "row-key", true, false, null, null, true, 10, ReadConsistency.STRONG))
            .thenReturn(expected.iterator());

    URI uri = UriBuilder.fromUri("/sor/1")
            .segment("table-name", "row-key", "timeline")
            .build();
    List<Change> actual = _resourceTestRule.client().resource(uri)
            .accept(MediaType.APPLICATION_JSON_TYPE)
            .header(ApiKeyRequest.AUTHENTICATION_HEADER, APIKEY_TABLE)
            .get(new GenericType<List<Change>>() {
            });

    assertEquals(actual.size(), expected.size());
    assertEquals(actual.get(0).getId(), expected.get(0).getId());
    assertEquals(actual.get(0).getDelta(), expected.get(0).getDelta());
    assertEquals(actual.get(0).getCompaction(), expected.get(0).getCompaction());
    verify(_server).getTimeline("table-name", "row-key", true, false, null, null, true, 10, ReadConsistency.STRONG);
    verifyNoMoreInteractions(_server);
}
 
Example #16
Source File: PasswordRecoveryApi.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * This is used to validate user challenge answer. If user challenge answer is valid, it will send another challenge question to answer until the status become &#x60;COMPLETE&#x60;. If the answer is wrong, user can retry the answer.
 *
 * @param answerVerificationRequest User answers verification with key returned in privious step. (required)
 * @return InitiateQuestionResponse
 * @throws ApiException if fails to make API call
 */
@Deprecated
public InitiateQuestionResponse validateAnswerPost(AnswerVerificationRequest answerVerificationRequest) throws ApiException {
    Object localVarPostBody = answerVerificationRequest;

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

    apiClient.setBasePath(basePath);

    // create path and map variables
    String localVarPath = "/validate-answer".replaceAll("\\{format\\}", "json");

    // 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"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

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

    GenericType<InitiateQuestionResponse> localVarReturnType = new GenericType<InitiateQuestionResponse>() {
    };
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
 
Example #17
Source File: DerivativesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Returns information about derivatives that correspond to a specific source
 * file, including derviative URNs and statuses. The URNs of the derivatives are
 * used to download the generated derivatives when calling the [GET
 * {urn}/manifest/{derivativeurn}](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-derivativeurn-GET)
 * endpoint. The statuses are used to verify whether the translation of
 * requested output files is complete. Note that different output files might
 * complete their translation processes at different times, and therefore may
 * have different &#x60;status&#x60; values. When translating a source file a
 * second time, the previously created manifest is not deleted; it appends the
 * information (only new translations) to the manifest.
 *
 * @param urn            The Base64 (URL Safe) encoded design URN (required)
 * @param acceptEncoding If specified with &#x60;gzip&#x60; or &#x60;*&#x60;,
 *                       content will be compressed and returned in a GZIP
 *                       format. (optional)
 * @return Manifest
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Manifest> getManifest(String urn, String acceptEncoding, Authentication oauth2,
		Credentials credentials) throws ApiException, Exception {

	Object localVarPostBody = null;

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

	// create path and map variables
	String localVarPath = "/modelderivative/v2/designdata/{urn}/manifest".replaceAll("\\{format\\}", "json")
			.replaceAll("\\{" + "urn" + "\\}", apiClient.escapeString(urn.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 (acceptEncoding != null)
		localVarHeaderParams.put("Accept-Encoding", apiClient.parameterToString(acceptEncoding));

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

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

	GenericType<Manifest> localVarReturnType = new GenericType<Manifest>() {
	};
	return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody,
			localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #18
Source File: DerivativesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Returns a list of model view (metadata) IDs for a design model. The metadata
 * ID enables end users to select an object tree and properties for a specific
 * model view. Although most design apps (e.g., Fusion and Inventor) only allow
 * a single model view (object tree and set of properties), some apps (e.g.,
 * Revit) allow users to design models with multiple model views (e.g., HVAC,
 * architecture, perspective). Note that you can only retrieve metadata from an
 * input file that has been translated into an SVF file.
 *
 * @param urn            The Base64 (URL Safe) encoded design URN (required)
 * @param acceptEncoding If specified with &#x60;gzip&#x60; or &#x60;*&#x60;,
 *                       content will be compressed and returned in a GZIP
 *                       format. (optional)
 * @return Metadata
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Metadata> getMetadata(String urn, String acceptEncoding, Authentication oauth2,
		Credentials credentials) throws ApiException, Exception {

	Object localVarPostBody = null;

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

	// create path and map variables
	String localVarPath = "/modelderivative/v2/designdata/{urn}/metadata".replaceAll("\\{format\\}", "json")
			.replaceAll("\\{" + "urn" + "\\}", apiClient.escapeString(urn.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 (acceptEncoding != null)
		localVarHeaderParams.put("Accept-Encoding", apiClient.parameterToString(acceptEncoding));

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

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

		GenericType<Metadata> localVarReturnType = new GenericType<Metadata>() {
	};
	return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody,
			localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #19
Source File: DerivativesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Returns the thumbnail for the source file.
 *
 * @param urn    The Base64 (URL Safe) encoded design URN (required)
 * @param width  The desired width of the thumbnail. Possible values are 100,
 *               200 and 400. (optional)
 * @param height The desired height of the thumbnail. Possible values are 100,
 *               200 and 400. (optional)
 * @return File
 * @throws ApiException if fails to make API call
 */
public ApiResponse<File> getThumbnail(String urn, Integer width, Integer height, Authentication oauth2,
		Credentials credentials) throws ApiException, Exception {

	Object localVarPostBody = null;

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

	// create path and map variables
	String localVarPath = "/modelderivative/v2/designdata/{urn}/thumbnail".replaceAll("\\{format\\}", "json")
			.replaceAll("\\{" + "urn" + "\\}", apiClient.escapeString(urn.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>();

	localVarQueryParams.addAll(apiClient.parameterToPairs("", "width", width));
	localVarQueryParams.addAll(apiClient.parameterToPairs("", "height", height));

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

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

	GenericType<File> localVarReturnType = new GenericType<File>() {
	};
	return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody,
			localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #20
Source File: DerivativesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 *
 * Translate a source file from one format to another. Derivatives are stored in
 * a manifest that is updated each time this endpoint is used on a source file.
 * Note that this endpoint is asynchronous and initiates a process that runs in
 * the background, rather than keeping an open HTTP connection until completion.
 * Use the [GET
 * {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET)
 * endpoint to poll for the job’s completion.
 *
 * @param job       (required)
 * @param xAdsForce &#x60;true&#x60;: the endpoint replaces previously
 *                  translated output file types with the newly generated
 *                  derivatives &#x60;false&#x60; (default): previously created
 *                  derivatives are not replaced (optional, default to false)
 * @return Job
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Job> translate(JobPayload job, Boolean xAdsForce, Authentication oauth2, Credentials credentials)
		throws ApiException, Exception {

	Object localVarPostBody = job;

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

	// create path and map variables
	String localVarPath = "/modelderivative/v2/designdata/job".replaceAll("\\{format\\}", "json");

	// 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 (xAdsForce != null)
		localVarHeaderParams.put("x-ads-force", apiClient.parameterToString(xAdsForce));

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

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

	GenericType<Job> localVarReturnType = new GenericType<Job>() {
	};
	return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody,
			localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #21
Source File: HubsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * Returns data on a specific &#x60;hub_id&#x60;. 
 * @param hubId the &#x60;hub id&#x60; for the current operation (required)
 * @return Hub
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Hub> getHub(String hubId,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'hubId' is set
  if (hubId == null) {
    throw new ApiException(400, "Missing the required parameter 'hubId' when calling getHub");
  }
  
  // create path and map variables
  String localVarPath = "/project/v1/hubs/{hub_id}".replaceAll("\\{format\\}","json")
    .replaceAll("\\{" + "hub_id" + "\\}", apiClient.escapeString(hubId.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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Hub> localVarReturnType = new GenericType<Hub>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #22
Source File: HubsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * Returns a collection of accessible hubs for this member. A Hub represents an A360 Team/Personal hub or a BIM 360 account. 
 * @param filterId filter by the &#x60;id&#x60; of the &#x60;ref&#x60; target (optional)
 * @param filterExtensionType filter by the extension type (optional)
 * @return Hubs
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Hubs> getHubs(List<String> filterId, List<String> filterExtensionType,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/project/v1/hubs".replaceAll("\\{format\\}","json");

  // 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("csv", "filter[id]", filterId));
  localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "filter[extension.type]", filterExtensionType));

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

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

  GenericType<Hubs> localVarReturnType = new GenericType<Hubs>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #23
Source File: AppPackagesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an AppPackage module.
 * 
 * @param appPackage  (required)
 * @return AppPackage
 * @throws ApiException if fails to make API call
 */
public ApiResponse<AppPackage> createAppPackage(AppPackage appPackage,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = appPackage;
  
  // verify the required parameter 'appPackage' is set
  if (appPackage == null) {
    throw new ApiException(400, "Missing the required parameter 'appPackage' when calling createAppPackage");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/AppPackages".replaceAll("\\{format\\}","json");

  // 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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<AppPackage> localVarReturnType = new GenericType<AppPackage>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #24
Source File: AppPackagesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the details of all AppPackages.
 * 
 * @return DesignAutomationAppPackages
 * @throws ApiException if fails to make API call
 */
public ApiResponse<DesignAutomationAppPackages> getAllAppPackages( Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/AppPackages".replaceAll("\\{format\\}","json");

  // 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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<DesignAutomationAppPackages> localVarReturnType = new GenericType<DesignAutomationAppPackages>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #25
Source File: ProjectCommandApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Verifies whether a Collaboration for Revit (C4R) model needs to be published to BIM 360 Docs.
 *
 * @param projectId the &#x60;project id&#x60; (required)
 * @param urn the urn of the object (required)
 * @return VersionCreated
 * @throws ApiException if fails to make API call
 */
public ApiResponse<CommandPublish> getPublishModelJob(String projectId, String urn, Authentication oauth2, Credentials credentials) throws ApiException, Exception {

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

    if (urn == null) {
        throw new ApiException(400, "Missing the required parameter 'urn' when calling postVersion");
    }

    // create path and map variables
    String localVarPath = "/data/v1/projects/{project_id}/commands"
            .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.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/vnd.api+json", "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

    Object localVarPostBody = createGetPublishModelBody(urn, TypeEnum.C4RModelGetPublishJob);
    GenericType<CommandPublish> localVarReturnType = new GenericType<CommandPublish>() {};
    return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
}
 
Example #26
Source File: EnginesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the details of a specific AutoCAD core engine.
 * 
 * @param id  (required)
 * @return Engine
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Engine> getEngine(String id,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'id' is set
  if (id == null) {
    throw new ApiException(400, "Missing the required parameter 'id' when calling getEngine");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/Engines('{id}')".replaceAll("\\{format\\}","json")
    .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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Engine> localVarReturnType = new GenericType<Engine>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #27
Source File: ActivitiesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the details of a specific Activity.
 * 
 * @param id  (required)
 * @return Activity
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Activity> getActivity(String id,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'id' is set
  if (id == null) {
    throw new ApiException(400, "Missing the required parameter 'id' when calling getActivity");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/Activities('{id}')".replaceAll("\\{format\\}","json")
    .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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Activity> localVarReturnType = new GenericType<Activity>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #28
Source File: ObjectsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * List objects in a bucket. It is only available to the bucket creator.
 * @param bucketKey URL-encoded bucket key (required)
 * @param limit Limit to the response size, Acceptable values: 1-100 Default &#x3D; 10  (optional, default to 10)
 * @param beginsWith Provides a way to filter the based on object key name (optional)
 * @param startAt Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response  (optional)
 * @return BucketObjects
 * @throws ApiException if fails to make API call
 */
public ApiResponse<BucketObjects> getObjects(String bucketKey, Integer limit, String beginsWith, String startAt,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = null;
  
  // verify the required parameter 'bucketKey' is set
  if (bucketKey == null) {
    throw new ApiException(400, "Missing the required parameter 'bucketKey' when calling getObjects");
  }
  
  // create path and map variables
  String localVarPath = "/oss/v2/buckets/{bucketKey}/objects".replaceAll("\\{format\\}","json")
    .replaceAll("\\{" + "bucketKey" + "\\}", apiClient.escapeString(bucketKey.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>();

  localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "beginsWith", beginsWith));
  localVarQueryParams.addAll(apiClient.parameterToPairs("", "startAt", startAt));

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

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

  GenericType<BucketObjects> localVarReturnType = new GenericType<BucketObjects>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #29
Source File: ActivitiesApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new Activity.
 * 
 * @param activity  (required)
 * @return Activity
 * @throws ApiException if fails to make API call
 */
public ApiResponse<Activity> createActivity(Activity activity,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = activity;
  
  // verify the required parameter 'activity' is set
  if (activity == null) {
    throw new ApiException(400, "Missing the required parameter 'activity' when calling createActivity");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/Activities".replaceAll("\\{format\\}","json");

  // 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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<Activity> localVarReturnType = new GenericType<Activity>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }
 
Example #30
Source File: WorkItemsApi.java    From forge-api-java-client with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new WorkItem.
 * 
 * @param workItem  (required)
 * @return WorkItemResp
 * @throws ApiException if fails to make API call
 */
public ApiResponse<WorkItemResp> createWorkItem(WorkItem workItem,  Authentication oauth2, Credentials credentials) throws ApiException, Exception {

  Object localVarPostBody = workItem;
  
  // verify the required parameter 'workItem' is set
  if (workItem == null) {
    throw new ApiException(400, "Missing the required parameter 'workItem' when calling createWorkItem");
  }
  
  // create path and map variables
  String localVarPath = "/autocad.io/us-east/v2/WorkItems".replaceAll("\\{format\\}","json");

  // 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/vnd.api+json", "application/json"
  };
  final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

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

  GenericType<WorkItemResp> localVarReturnType = new GenericType<WorkItemResp>() {};
  return apiClient.invokeAPI(oauth2, credentials, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarReturnType);
    }