Skip to content

Latest commit

 

History

History
736 lines (543 loc) · 19.9 KB

TransmemApi.md

File metadata and controls

736 lines (543 loc) · 19.9 KB

Com.Gridly.Api.TransmemApi

All URIs are relative to https://api.gridly.com

Method HTTP request Description
Cleanup PUT /v1/transmems/{tmId}/cleanup Erases all the translation data of the provided tmId
Create POST /v1/transmems Create a new translation memory
CreateWithFile POST /v1/transmems/upload Create a new translation memory by uploading tmx file
Delete DELETE /v1/transmems/{tmId} Delete a translation memory by id
Export GET /v1/transmems/{tmId}/export Export translation memory tmx file
Get GET /v1/transmems/{tmId} Get translation memory info by id
ImportTmx POST /v1/transmems/{tmId}/import Import a translation memory from tmx file
ListTM GET /v1/transmems List all available translation memories or create default one if there is no translation memory
Update PUT /v1/transmems/{tmId} Update a translation memory

Cleanup

void Cleanup (string tmId)

Erases all the translation data of the provided tmId

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class CleanupExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 

            try
            {
                // Erases all the translation data of the provided tmId
                apiInstance.Cleanup(tmId);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Cleanup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No Content -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Create

TransMem Create (CreateTransMem createTransMem = null)

Create a new translation memory

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class CreateExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var createTransMem = new CreateTransMem(); // CreateTransMem |  (optional) 

            try
            {
                // Create a new translation memory
                TransMem result = apiInstance.Create(createTransMem);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Create: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
createTransMem CreateTransMem [optional]

Return type

TransMem

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Create a new translation memory successful ! -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateWithFile

TransMem CreateWithFile (System.IO.Stream file)

Create a new translation memory by uploading tmx file

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class CreateWithFileExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream | 

            try
            {
                // Create a new translation memory by uploading tmx file
                TransMem result = apiInstance.CreateWithFile(file);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.CreateWithFile: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
file System.IO.Stream

Return type

TransMem

Authorization

ApiKey

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Create a new translation memory based on provided tmx file successfully ! -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Delete

TransMem Delete (string tmId)

Delete a translation memory by id

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class DeleteExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 

            try
            {
                // Delete a translation memory by id
                TransMem result = apiInstance.Delete(tmId);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Delete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string

Return type

TransMem

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Export

System.IO.Stream Export (string tmId, ExportFormat? format = null, string sourceLang = null, List targetLangs = null)

Export translation memory tmx file

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class ExportExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 
            var format = new ExportFormat();  // ExportFormat? |  (optional) 
            var sourceLang = "sourceLang_example";  // string |  (optional) 
            var targetLangs = new List<string>(); // List<string> |  (optional) 

            try
            {
                // Export translation memory tmx file
                System.IO.Stream result = apiInstance.Export(tmId, format, sourceLang, targetLangs);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Export: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string
format ExportFormat? [optional]
sourceLang string [optional]
targetLangs List<string> [optional]

Return type

System.IO.Stream

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Get

TransMem Get (string tmId)

Get translation memory info by id

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class GetExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 

            try
            {
                // Get translation memory info by id
                TransMem result = apiInstance.Get(tmId);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Get: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string

Return type

TransMem

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ImportTmx

void ImportTmx (string tmId, System.IO.Stream file)

Import a translation memory from tmx file

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class ImportTmxExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 
            var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt"));  // System.IO.Stream | 

            try
            {
                // Import a translation memory from tmx file
                apiInstance.ImportTmx(tmId, file);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.ImportTmx: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string
file System.IO.Stream

Return type

void (empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Import tmx file successfully -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListTM

List<TransMem> ListTM (long? projectId = null)

List all available translation memories or create default one if there is no translation memory

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class ListTMExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var projectId = 789L;  // long? |  (optional) 

            try
            {
                // List all available translation memories or create default one if there is no translation memory
                List<TransMem> result = apiInstance.ListTM(projectId);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.ListTM: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId long? [optional]

Return type

List<TransMem>

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update

TransMem Update (string tmId, UpdateTransMem updateTransMem = null)

Update a translation memory

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Gridly.Api;
using Com.Gridly.Client;
using Com.Gridly.Model;

namespace Example
{
    public class UpdateExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.gridly.com";
            // Configure API key authorization: ApiKey
            Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new TransmemApi(Configuration.Default);
            var tmId = "tmId_example";  // string | 
            var updateTransMem = new UpdateTransMem(); // UpdateTransMem |  (optional) 

            try
            {
                // Update a translation memory
                TransMem result = apiInstance.Update(tmId, updateTransMem);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TransmemApi.Update: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
tmId string
updateTransMem UpdateTransMem [optional]

Return type

TransMem

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]