@Override
    public DocumentTranslationRequestData updateDocumentTranslationRequest(
            String trId, DocumentTranslationRequestDataChangeSet changeSet)
            throws ServiceException {
        if (trId == null || trId.isEmpty()) {
            throw new IllegalArgumentException("Non-empty trId must be specified.");
        }
        if (changeSet == null) {
            throw new IllegalArgumentException("Non-null changeSet must be specified.");
        }

        RestInputDocumentTranslationRequestData restChangeSet = new RestInputDocumentTranslationRequestData(changeSet);
        Gson gson = createGson(RestInputDocumentTranslationRequestData.class.getName());
        String jsonBody = gson.toJson(restChangeSet, RestInputDocumentTranslationRequestData.class);
        DocumentTranslationRequestResponse resp = invokeApiJson(
                "POST",
                escapePathSegment(account.getInstanceId()) + "/v2/doc-trs/"
                        + escapePathSegment(trId),
                jsonBody,
                DocumentTranslationRequestResponse.class);

        if (resp.getStatus() == Status.ERROR) {
            throw new ServiceException(resp.getMessage());
        }

        return new DocumentTranslationRequestDataImpl(resp.id, resp.translationRequest);
    }
@ Override public DocumentTranslationRequestData updateDocumentTranslationRequest ( String trId , DocumentTranslationRequestDataChangeSet changeSet ) throws ServiceException { if ( trId == null || trId . isEmpty ( ) ) { throw new IllegalArgumentException ( "Non-empty trId must be specified." ) ; } if ( changeSet == null ) { throw new IllegalArgumentException ( "Non-null changeSet must be specified." ) ; } RestInputDocumentTranslationRequestData restChangeSet = new RestInputDocumentTranslationRequestData ( changeSet ) ; Gson gson = createGson ( RestInputDocumentTranslationRequestData . class . getName ( ) ) ; String jsonBody = gson . toJson ( restChangeSet , RestInputDocumentTranslationRequestData . class ) ; DocumentTranslationRequestResponse resp = invokeApiJson ( "POST" , escapePathSegment ( account . getInstanceId ( ) ) + "/v2/doc-trs/" + escapePathSegment ( trId ) , jsonBody , DocumentTranslationRequestResponse . class ) ; if ( resp . getStatus ( ) == Status . ERROR ) { throw new ServiceException ( resp . getMessage ( ) ) ; } return new DocumentTranslationRequestDataImpl ( resp . id , resp . translationRequest ) ; }
/* (non-Javadoc)
@see com.ibm.g11n.pipeline.client.ServiceClient#updateDocumentTranslationRequest(java.lang.String, com.ibm.g11n.pipeline.client.DocumentTranslationRequestDataChangeSet)