Search in sources :

Example 86 with ResponseBody

use of okhttp3.ResponseBody in project azure-sdk-for-java by Azure.

the class CertificatesImpl method cancelDeletion.

/**
     * Cancels a failed deletion of a certificate from the specified account.
     *
     * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1.
     * @param thumbprint The thumbprint of the certificate being deleted.
     * @param certificateCancelDeletionOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, CertificateCancelDeletionHeaders> cancelDeletion(String thumbprintAlgorithm, String thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (thumbprintAlgorithm == null) {
        throw new IllegalArgumentException("Parameter thumbprintAlgorithm is required and cannot be null.");
    }
    if (thumbprint == null) {
        throw new IllegalArgumentException("Parameter thumbprint is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(certificateCancelDeletionOptions);
    Integer timeout = null;
    if (certificateCancelDeletionOptions != null) {
        timeout = certificateCancelDeletionOptions.timeout();
    }
    String clientRequestId = null;
    if (certificateCancelDeletionOptions != null) {
        clientRequestId = certificateCancelDeletionOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (certificateCancelDeletionOptions != null) {
        returnClientRequestId = certificateCancelDeletionOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (certificateCancelDeletionOptions != null) {
        ocpDate = certificateCancelDeletionOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.cancelDeletion(thumbprintAlgorithm, thumbprint, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return cancelDeletionDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 87 with ResponseBody

use of okhttp3.ResponseBody in project azure-sdk-for-java by Azure.

the class CertificatesImpl method listNext.

/**
     * Lists all of the certificates that have been added to the specified account.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param certificateListNextOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the List&lt;Certificate&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PageImpl<Certificate>, CertificateListHeaders> listNext(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    Validator.validate(certificateListNextOptions);
    String clientRequestId = null;
    if (certificateListNextOptions != null) {
        clientRequestId = certificateListNextOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (certificateListNextOptions != null) {
        returnClientRequestId = certificateListNextOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (certificateListNextOptions != null) {
        ocpDate = certificateListNextOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.listNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return listNextDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 88 with ResponseBody

use of okhttp3.ResponseBody in project azure-sdk-for-java by Azure.

the class ComputeNodesImpl method get.

/**
     * Gets information about the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the compute node that you want to get information about.
     * @param computeNodeGetOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the ComputeNode object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders> get(String poolId, String nodeId, ComputeNodeGetOptions computeNodeGetOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (poolId == null) {
        throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
    }
    if (nodeId == null) {
        throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(computeNodeGetOptions);
    String select = null;
    if (computeNodeGetOptions != null) {
        select = computeNodeGetOptions.select();
    }
    Integer timeout = null;
    if (computeNodeGetOptions != null) {
        timeout = computeNodeGetOptions.timeout();
    }
    String clientRequestId = null;
    if (computeNodeGetOptions != null) {
        clientRequestId = computeNodeGetOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (computeNodeGetOptions != null) {
        returnClientRequestId = computeNodeGetOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (computeNodeGetOptions != null) {
        ocpDate = computeNodeGetOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.get(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return getDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 89 with ResponseBody

use of okhttp3.ResponseBody in project azure-sdk-for-java by Azure.

the class ComputeNodesImpl method reboot.

/**
     * Restarts the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the compute node that you want to restart.
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, ComputeNodeRebootHeaders> reboot(String poolId, String nodeId) throws BatchErrorException, IOException, IllegalArgumentException {
    if (poolId == null) {
        throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
    }
    if (nodeId == null) {
        throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final ComputeNodeRebootOption nodeRebootOption = null;
    final ComputeNodeRebootOptions computeNodeRebootOptions = null;
    Integer timeout = null;
    String clientRequestId = null;
    Boolean returnClientRequestId = null;
    DateTime ocpDate = null;
    NodeRebootParameter nodeRebootParameter = new NodeRebootParameter();
    nodeRebootParameter.withNodeRebootOption(null);
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.reboot(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, nodeRebootParameter, this.client.userAgent());
    return rebootDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) ComputeNodeRebootOption(com.microsoft.azure.batch.protocol.models.ComputeNodeRebootOption) NodeRebootParameter(com.microsoft.azure.batch.protocol.models.NodeRebootParameter) ComputeNodeRebootOptions(com.microsoft.azure.batch.protocol.models.ComputeNodeRebootOptions) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 90 with ResponseBody

use of okhttp3.ResponseBody in project azure-sdk-for-java by Azure.

the class ComputeNodesImpl method updateUser.

/**
     * Updates the password or expiration time of a user account on the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the machine on which you want to update a user account.
     * @param userName The name of the user account to update.
     * @param nodeUpdateUserParameter The parameters for the request.
     * @param computeNodeUpdateUserOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, ComputeNodeUpdateUserHeaders> updateUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, ComputeNodeUpdateUserOptions computeNodeUpdateUserOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (poolId == null) {
        throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
    }
    if (nodeId == null) {
        throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
    }
    if (userName == null) {
        throw new IllegalArgumentException("Parameter userName is required and cannot be null.");
    }
    if (nodeUpdateUserParameter == null) {
        throw new IllegalArgumentException("Parameter nodeUpdateUserParameter is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(nodeUpdateUserParameter);
    Validator.validate(computeNodeUpdateUserOptions);
    Integer timeout = null;
    if (computeNodeUpdateUserOptions != null) {
        timeout = computeNodeUpdateUserOptions.timeout();
    }
    String clientRequestId = null;
    if (computeNodeUpdateUserOptions != null) {
        clientRequestId = computeNodeUpdateUserOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (computeNodeUpdateUserOptions != null) {
        returnClientRequestId = computeNodeUpdateUserOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (computeNodeUpdateUserOptions != null) {
        ocpDate = computeNodeUpdateUserOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.updateUser(poolId, nodeId, userName, nodeUpdateUserParameter, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return updateUserDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Aggregations

ResponseBody (okhttp3.ResponseBody)584 DateTimeRfc1123 (com.microsoft.rest.DateTimeRfc1123)332 DateTime (org.joda.time.DateTime)332 ServiceCall (com.microsoft.rest.ServiceCall)140 Test (org.junit.Test)123 Request (okhttp3.Request)112 Observable (rx.Observable)97 Response (retrofit2.Response)94 ServiceResponse (com.microsoft.rest.ServiceResponse)92 PagedList (com.microsoft.azure.PagedList)80 ServiceResponseWithHeaders (com.microsoft.rest.ServiceResponseWithHeaders)78 List (java.util.List)64 IOException (java.io.IOException)33 Response (okhttp3.Response)33 Buffer (okio.Buffer)33 RequestBody (okhttp3.RequestBody)31 PageImpl (com.microsoft.azure.batch.protocol.models.PageImpl)26 MockResponse (okhttp3.mockwebserver.MockResponse)24 InputStream (java.io.InputStream)19 MultipartBody (okhttp3.MultipartBody)16