
com.amazonaws.services.devicefarm.AWSDeviceFarmClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-devicefarm Show documentation
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.devicefarm;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.services.devicefarm.model.*;
import com.amazonaws.services.devicefarm.model.transform.*;
/**
* Client for accessing AWS Device Farm. All service calls made using this
* client are blocking, and will not return until the service call completes.
*
*
* AWS Device Farm is a service that enables mobile app developers to test
* Android, iOS, and Fire OS apps on physical phones, tablets, and other devices
* in the cloud.
*
*/
@ThreadSafe
public class AWSDeviceFarmClient extends AmazonWebServiceClient implements
AWSDeviceFarm {
/** Provider for AWS credentials. */
private AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSDeviceFarm.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "devicefarm";
/** The region metadata service name for computing region endpoints. */
private static final String DEFAULT_ENDPOINT_PREFIX = "devicefarm";
/**
* Client configuration factory providing ClientConfigurations tailored to
* this client
*/
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final SdkJsonProtocolFactory protocolFactory = new SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("NotEligibleException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.NotEligibleException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("ArgumentException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.ArgumentException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("NotFoundException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.NotFoundException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("LimitExceededException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.LimitExceededException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("ServiceAccountException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.ServiceAccountException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata()
.withErrorCode("IdempotencyException")
.withModeledClass(
com.amazonaws.services.devicefarm.model.IdempotencyException.class)));
/**
* Constructs a new client to invoke service methods on AWS Device Farm. A
* credentials provider chain will be used that searches for credentials in
* this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @see DefaultAWSCredentialsProviderChain
*/
public AWSDeviceFarmClient() {
this(new DefaultAWSCredentialsProviderChain(), configFactory
.getConfig());
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm. A
* credentials provider chain will be used that searches for credentials in
* this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param clientConfiguration
* The client configuration options controlling how this client
* connects to AWS Device Farm (ex: proxy settings, retry counts,
* etc.).
*
* @see DefaultAWSCredentialsProviderChain
*/
public AWSDeviceFarmClient(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm
* using the specified AWS account credentials.
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when
* authenticating with AWS services.
*/
public AWSDeviceFarmClient(AWSCredentials awsCredentials) {
this(awsCredentials, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm
* using the specified AWS account credentials and client configuration
* options.
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when
* authenticating with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client
* connects to AWS Device Farm (ex: proxy settings, retry counts,
* etc.).
*/
public AWSDeviceFarmClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(
awsCredentials);
init();
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm
* using the specified AWS account credentials provider.
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to
* authenticate requests with AWS services.
*/
public AWSDeviceFarmClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm
* using the specified AWS account credentials provider and client
* configuration options.
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to
* authenticate requests with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client
* connects to AWS Device Farm (ex: proxy settings, retry counts,
* etc.).
*/
public AWSDeviceFarmClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, null);
}
/**
* Constructs a new client to invoke service methods on AWS Device Farm
* using the specified AWS account credentials provider, client
* configuration options, and request metric collector.
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to
* authenticate requests with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client
* connects to AWS Device Farm (ex: proxy settings, retry counts,
* etc.).
* @param requestMetricCollector
* optional request metric collector
*/
public AWSDeviceFarmClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(DEFAULT_ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("https://devicefarm.us-west-2.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s
.addAll(chainFactory
.newRequestHandlerChain("/com/amazonaws/services/devicefarm/request.handlers"));
requestHandler2s
.addAll(chainFactory
.newRequestHandler2Chain("/com/amazonaws/services/devicefarm/request.handler2s"));
}
/**
*
* Creates a device pool.
*
*
* @param createDevicePoolRequest
* Represents a request to the create device pool operation.
* @return Result of the CreateDevicePool operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.CreateDevicePool
*/
@Override
public CreateDevicePoolResult createDevicePool(
CreateDevicePoolRequest createDevicePoolRequest) {
ExecutionContext executionContext = createExecutionContext(createDevicePoolRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDevicePoolRequestMarshaller(protocolFactory)
.marshall(super
.beforeMarshalling(createDevicePoolRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new CreateDevicePoolResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new project.
*
*
* @param createProjectRequest
* Represents a request to the create project operation.
* @return Result of the CreateProject operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.CreateProject
*/
@Override
public CreateProjectResult createProject(
CreateProjectRequest createProjectRequest) {
ExecutionContext executionContext = createExecutionContext(createProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProjectRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(createProjectRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new CreateProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Uploads an app or test scripts.
*
*
* @param createUploadRequest
* Represents a request to the create upload operation.
* @return Result of the CreateUpload operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.CreateUpload
*/
@Override
public CreateUploadResult createUpload(
CreateUploadRequest createUploadRequest) {
ExecutionContext executionContext = createExecutionContext(createUploadRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateUploadRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(createUploadRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new CreateUploadResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a device pool given the pool ARN. Does not allow deletion of
* curated pools owned by the system.
*
*
* @param deleteDevicePoolRequest
* Represents a request to the delete device pool operation.
* @return Result of the DeleteDevicePool operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.DeleteDevicePool
*/
@Override
public DeleteDevicePoolResult deleteDevicePool(
DeleteDevicePoolRequest deleteDevicePoolRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDevicePoolRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDevicePoolRequestMarshaller(protocolFactory)
.marshall(super
.beforeMarshalling(deleteDevicePoolRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new DeleteDevicePoolResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an AWS Device Farm project, given the project ARN.
*
*
* Note Deleting this resource does not stop an in-progress run.
*
*
* @param deleteProjectRequest
* Represents a request to the delete project operation.
* @return Result of the DeleteProject operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.DeleteProject
*/
@Override
public DeleteProjectResult deleteProject(
DeleteProjectRequest deleteProjectRequest) {
ExecutionContext executionContext = createExecutionContext(deleteProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteProjectRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(deleteProjectRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new DeleteProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the run, given the run ARN.
*
*
* Note Deleting this resource does not stop an in-progress run.
*
*
* @param deleteRunRequest
* Represents a request to the delete run operation.
* @return Result of the DeleteRun operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.DeleteRun
*/
@Override
public DeleteRunResult deleteRun(DeleteRunRequest deleteRunRequest) {
ExecutionContext executionContext = createExecutionContext(deleteRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteRunRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(deleteRunRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new DeleteRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an upload given the upload ARN.
*
*
* @param deleteUploadRequest
* Represents a request to the delete upload operation.
* @return Result of the DeleteUpload operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.DeleteUpload
*/
@Override
public DeleteUploadResult deleteUpload(
DeleteUploadRequest deleteUploadRequest) {
ExecutionContext executionContext = createExecutionContext(deleteUploadRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteUploadRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(deleteUploadRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new DeleteUploadResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns the number of unmetered iOS and/or unmetered Android devices that
* have been purchased by the account.
*
*
* @param getAccountSettingsRequest
* Represents the request sent to retrieve the account settings.
* @return Result of the GetAccountSettings operation returned by the
* service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetAccountSettings
*/
@Override
public GetAccountSettingsResult getAccountSettings(
GetAccountSettingsRequest getAccountSettingsRequest) {
ExecutionContext executionContext = createExecutionContext(getAccountSettingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetAccountSettingsRequestMarshaller(
protocolFactory).marshall(super
.beforeMarshalling(getAccountSettingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetAccountSettingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a unique device type.
*
*
* @param getDeviceRequest
* Represents a request to the get device request.
* @return Result of the GetDevice operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetDevice
*/
@Override
public GetDeviceResult getDevice(GetDeviceRequest getDeviceRequest) {
ExecutionContext executionContext = createExecutionContext(getDeviceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDeviceRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getDeviceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetDeviceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a device pool.
*
*
* @param getDevicePoolRequest
* Represents a request to the get device pool operation.
* @return Result of the GetDevicePool operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetDevicePool
*/
@Override
public GetDevicePoolResult getDevicePool(
GetDevicePoolRequest getDevicePoolRequest) {
ExecutionContext executionContext = createExecutionContext(getDevicePoolRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDevicePoolRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getDevicePoolRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetDevicePoolResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about compatibility with a device pool.
*
*
* @param getDevicePoolCompatibilityRequest
* Represents a request to the get device pool compatibility
* operation.
* @return Result of the GetDevicePoolCompatibility operation returned by
* the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetDevicePoolCompatibility
*/
@Override
public GetDevicePoolCompatibilityResult getDevicePoolCompatibility(
GetDevicePoolCompatibilityRequest getDevicePoolCompatibilityRequest) {
ExecutionContext executionContext = createExecutionContext(getDevicePoolCompatibilityRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDevicePoolCompatibilityRequestMarshaller(
protocolFactory).marshall(super
.beforeMarshalling(getDevicePoolCompatibilityRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetDevicePoolCompatibilityResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a job.
*
*
* @param getJobRequest
* Represents a request to the get job operation.
* @return Result of the GetJob operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetJob
*/
@Override
public GetJobResult getJob(GetJobRequest getJobRequest) {
ExecutionContext executionContext = createExecutionContext(getJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetJobRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getJobRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetJobResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets the current status and future status of all offerings purchased by
* an AWS account. The response indicates how many offerings are currently
* available and the offerings that will be available in the next period.
* The API returns a NotEligible
error if the user is not
* permitted to invoke the operation. Please contact [email protected] if you believe that you should be
* able to invoke this operation.
*
*
* @param getOfferingStatusRequest
* Represents the request to retrieve the offering status for the
* specified customer or account.
* @return Result of the GetOfferingStatus operation returned by the
* service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws NotEligibleException
* Exception gets thrown when a user is not eligible to perform the
* specified transaction.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetOfferingStatus
*/
@Override
public GetOfferingStatusResult getOfferingStatus(
GetOfferingStatusRequest getOfferingStatusRequest) {
ExecutionContext executionContext = createExecutionContext(getOfferingStatusRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetOfferingStatusRequestMarshaller(
protocolFactory).marshall(super
.beforeMarshalling(getOfferingStatusRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetOfferingStatusResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a project.
*
*
* @param getProjectRequest
* Represents a request to the get project operation.
* @return Result of the GetProject operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetProject
*/
@Override
public GetProjectResult getProject(GetProjectRequest getProjectRequest) {
ExecutionContext executionContext = createExecutionContext(getProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetProjectRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getProjectRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a run.
*
*
* @param getRunRequest
* Represents a request to the get run operation.
* @return Result of the GetRun operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetRun
*/
@Override
public GetRunResult getRun(GetRunRequest getRunRequest) {
ExecutionContext executionContext = createExecutionContext(getRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetRunRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getRunRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a suite.
*
*
* @param getSuiteRequest
* Represents a request to the get suite operation.
* @return Result of the GetSuite operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetSuite
*/
@Override
public GetSuiteResult getSuite(GetSuiteRequest getSuiteRequest) {
ExecutionContext executionContext = createExecutionContext(getSuiteRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetSuiteRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getSuiteRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetSuiteResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about a test.
*
*
* @param getTestRequest
* Represents a request to the get test operation.
* @return Result of the GetTest operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetTest
*/
@Override
public GetTestResult getTest(GetTestRequest getTestRequest) {
ExecutionContext executionContext = createExecutionContext(getTestRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetTestRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getTestRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetTestResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about an upload.
*
*
* @param getUploadRequest
* Represents a request to the get upload operation.
* @return Result of the GetUpload operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.GetUpload
*/
@Override
public GetUploadResult getUpload(GetUploadRequest getUploadRequest) {
ExecutionContext executionContext = createExecutionContext(getUploadRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetUploadRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(getUploadRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new GetUploadResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about artifacts.
*
*
* @param listArtifactsRequest
* Represents a request to the list artifacts operation.
* @return Result of the ListArtifacts operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListArtifacts
*/
@Override
public ListArtifactsResult listArtifacts(
ListArtifactsRequest listArtifactsRequest) {
ExecutionContext executionContext = createExecutionContext(listArtifactsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListArtifactsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listArtifactsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListArtifactsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about device pools.
*
*
* @param listDevicePoolsRequest
* Represents the result of a list device pools request.
* @return Result of the ListDevicePools operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListDevicePools
*/
@Override
public ListDevicePoolsResult listDevicePools(
ListDevicePoolsRequest listDevicePoolsRequest) {
ExecutionContext executionContext = createExecutionContext(listDevicePoolsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDevicePoolsRequestMarshaller(protocolFactory)
.marshall(super
.beforeMarshalling(listDevicePoolsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListDevicePoolsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about unique device types.
*
*
* @param listDevicesRequest
* Represents the result of a list devices request.
* @return Result of the ListDevices operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListDevices
*/
@Override
public ListDevicesResult listDevices(ListDevicesRequest listDevicesRequest) {
ExecutionContext executionContext = createExecutionContext(listDevicesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDevicesRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listDevicesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListDevicesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about jobs.
*
*
* @param listJobsRequest
* Represents a request to the list jobs operation.
* @return Result of the ListJobs operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListJobs
*/
@Override
public ListJobsResult listJobs(ListJobsRequest listJobsRequest) {
ExecutionContext executionContext = createExecutionContext(listJobsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListJobsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listJobsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListJobsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of all historical purchases, renewals, and system renewal
* transactions for an AWS account. The list is paginated and ordered by a
* descending timestamp (most recent transactions are first). The API
* returns a NotEligible
error if the user is not permitted to
* invoke the operation. Please contact [email protected] if you believe that you should be
* able to invoke this operation.
*
*
* @param listOfferingTransactionsRequest
* Represents the request to list the offering transaction history.
* @return Result of the ListOfferingTransactions operation returned by the
* service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws NotEligibleException
* Exception gets thrown when a user is not eligible to perform the
* specified transaction.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListOfferingTransactions
*/
@Override
public ListOfferingTransactionsResult listOfferingTransactions(
ListOfferingTransactionsRequest listOfferingTransactionsRequest) {
ExecutionContext executionContext = createExecutionContext(listOfferingTransactionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListOfferingTransactionsRequestMarshaller(
protocolFactory).marshall(super
.beforeMarshalling(listOfferingTransactionsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListOfferingTransactionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of products or offerings that the user can manage through
* the API. Each offering record indicates the recurring price per unit and
* the frequency for that offering. The API returns a
* NotEligible
error if the user is not permitted to invoke the
* operation. Please contact [email protected] if you believe that you should be
* able to invoke this operation.
*
*
* @param listOfferingsRequest
* Represents the request to list all offerings.
* @return Result of the ListOfferings operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws NotEligibleException
* Exception gets thrown when a user is not eligible to perform the
* specified transaction.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListOfferings
*/
@Override
public ListOfferingsResult listOfferings(
ListOfferingsRequest listOfferingsRequest) {
ExecutionContext executionContext = createExecutionContext(listOfferingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListOfferingsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listOfferingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListOfferingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about projects.
*
*
* @param listProjectsRequest
* Represents a request to the list projects operation.
* @return Result of the ListProjects operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListProjects
*/
@Override
public ListProjectsResult listProjects(
ListProjectsRequest listProjectsRequest) {
ExecutionContext executionContext = createExecutionContext(listProjectsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListProjectsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listProjectsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListProjectsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about runs.
*
*
* @param listRunsRequest
* Represents a request to the list runs operation.
* @return Result of the ListRuns operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListRuns
*/
@Override
public ListRunsResult listRuns(ListRunsRequest listRunsRequest) {
ExecutionContext executionContext = createExecutionContext(listRunsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListRunsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listRunsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListRunsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about samples.
*
*
* @param listSamplesRequest
* Represents a request to the list samples operation.
* @return Result of the ListSamples operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListSamples
*/
@Override
public ListSamplesResult listSamples(ListSamplesRequest listSamplesRequest) {
ExecutionContext executionContext = createExecutionContext(listSamplesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListSamplesRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listSamplesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListSamplesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about suites.
*
*
* @param listSuitesRequest
* Represents a request to the list suites operation.
* @return Result of the ListSuites operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListSuites
*/
@Override
public ListSuitesResult listSuites(ListSuitesRequest listSuitesRequest) {
ExecutionContext executionContext = createExecutionContext(listSuitesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListSuitesRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listSuitesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListSuitesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about tests.
*
*
* @param listTestsRequest
* Represents a request to the list tests operation.
* @return Result of the ListTests operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListTests
*/
@Override
public ListTestsResult listTests(ListTestsRequest listTestsRequest) {
ExecutionContext executionContext = createExecutionContext(listTestsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTestsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listTestsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListTestsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about unique problems.
*
*
* @param listUniqueProblemsRequest
* Represents a request to the list unique problems operation.
* @return Result of the ListUniqueProblems operation returned by the
* service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListUniqueProblems
*/
@Override
public ListUniqueProblemsResult listUniqueProblems(
ListUniqueProblemsRequest listUniqueProblemsRequest) {
ExecutionContext executionContext = createExecutionContext(listUniqueProblemsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListUniqueProblemsRequestMarshaller(
protocolFactory).marshall(super
.beforeMarshalling(listUniqueProblemsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListUniqueProblemsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Gets information about uploads.
*
*
* @param listUploadsRequest
* Represents a request to the list uploads operation.
* @return Result of the ListUploads operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ListUploads
*/
@Override
public ListUploadsResult listUploads(ListUploadsRequest listUploadsRequest) {
ExecutionContext executionContext = createExecutionContext(listUploadsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListUploadsRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(listUploadsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ListUploadsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Immediately purchases offerings for an AWS account. Offerings renew with
* the latest total purchased quantity for an offering, unless the renewal
* was overridden. The API returns a NotEligible
error if the
* user is not permitted to invoke the operation. Please contact [email protected] if you believe that you should be
* able to invoke this operation.
*
*
* @param purchaseOfferingRequest
* Represents a request for a purchase offering.
* @return Result of the PurchaseOffering operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws NotEligibleException
* Exception gets thrown when a user is not eligible to perform the
* specified transaction.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.PurchaseOffering
*/
@Override
public PurchaseOfferingResult purchaseOffering(
PurchaseOfferingRequest purchaseOfferingRequest) {
ExecutionContext executionContext = createExecutionContext(purchaseOfferingRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new PurchaseOfferingRequestMarshaller(protocolFactory)
.marshall(super
.beforeMarshalling(purchaseOfferingRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new PurchaseOfferingResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Explicitly sets the quantity of devices to renew for an offering,
* starting from the effectiveDate
of the next period. The API
* returns a NotEligible
error if the user is not permitted to
* invoke the operation. Please contact [email protected] if you believe that you should be
* able to invoke this operation.
*
*
* @param renewOfferingRequest
* A request representing an offering renewal.
* @return Result of the RenewOffering operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws NotEligibleException
* Exception gets thrown when a user is not eligible to perform the
* specified transaction.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.RenewOffering
*/
@Override
public RenewOfferingResult renewOffering(
RenewOfferingRequest renewOfferingRequest) {
ExecutionContext executionContext = createExecutionContext(renewOfferingRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new RenewOfferingRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(renewOfferingRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new RenewOfferingResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Schedules a run.
*
*
* @param scheduleRunRequest
* Represents a request to the schedule run operation.
* @return Result of the ScheduleRun operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws IdempotencyException
* An entity with the same name already exists.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.ScheduleRun
*/
@Override
public ScheduleRunResult scheduleRun(ScheduleRunRequest scheduleRunRequest) {
ExecutionContext executionContext = createExecutionContext(scheduleRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ScheduleRunRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(scheduleRunRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new ScheduleRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Initiates a stop request for the current test run. AWS Device Farm will
* immediately stop the run on devices where tests have not started
* executing, and you will not be billed for these devices. On devices where
* tests have started executing, Setup Suite and Teardown Suite tests will
* run to completion before stopping execution on those devices. You will be
* billed for Setup, Teardown, and any tests that were in progress or
* already completed.
*
*
* @param stopRunRequest
* Represents the request to stop a specific run.
* @return Result of the StopRun operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.StopRun
*/
@Override
public StopRunResult stopRun(StopRunRequest stopRunRequest) {
ExecutionContext executionContext = createExecutionContext(stopRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StopRunRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(stopRunRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new StopRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Modifies the name, description, and rules in a device pool given the
* attributes and the pool ARN. Rule updates are all-or-nothing, meaning
* they can only be updated as a whole (or not at all).
*
*
* @param updateDevicePoolRequest
* Represents a request to the update device pool operation.
* @return Result of the UpdateDevicePool operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.UpdateDevicePool
*/
@Override
public UpdateDevicePoolResult updateDevicePool(
UpdateDevicePoolRequest updateDevicePoolRequest) {
ExecutionContext executionContext = createExecutionContext(updateDevicePoolRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateDevicePoolRequestMarshaller(protocolFactory)
.marshall(super
.beforeMarshalling(updateDevicePoolRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new UpdateDevicePoolResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Modifies the specified project name, given the project ARN and a new
* name.
*
*
* @param updateProjectRequest
* Represents a request to the update project operation.
* @return Result of the UpdateProject operation returned by the service.
* @throws ArgumentException
* An invalid argument was specified.
* @throws NotFoundException
* The specified entity was not found.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ServiceAccountException
* There was a problem with the service account.
* @sample AWSDeviceFarm.UpdateProject
*/
@Override
public UpdateProjectResult updateProject(
UpdateProjectRequest updateProjectRequest) {
ExecutionContext executionContext = createExecutionContext(updateProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext
.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateProjectRequestMarshaller(protocolFactory)
.marshall(super.beforeMarshalling(updateProjectRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true)
.withHasStreamingSuccessResponse(false),
new UpdateProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful,
* request, typically used for debugging issues where a service isn't acting
* as expected. This data isn't considered part of the result data returned
* by an operation, so it's available through this separate, diagnostic
* interface.
*
* Response metadata is only cached for a limited period of time, so if you
* need to access this extra diagnostic information for an executed request,
* you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none
* is available.
*/
public ResponseMetadata getCachedResponseMetadata(
AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be
* overriden at the request level.
**/
private Response invoke(
Request request,
HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
executionContext.setCredentialsProvider(CredentialUtils
.getCredentialsProvider(request.getOriginalRequest(),
awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext);
}
/**
* Invoke with no authentication. Credentials are not required and any
* credentials set on the client or request will be ignored for this
* operation.
**/
private Response anonymousInvoke(
Request request,
HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack
* thereof) have been configured in the ExecutionContext beforehand.
**/
private Response doInvoke(
Request request,
HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
request.setEndpoint(endpoint);
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory
.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler,
executionContext);
}
}