Skip to content

ninotosh/gengo-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

gengo-swift

A fully objectified client in Swift for the Gengo API

Usage

let gengo = Gengo(publicKey: "...", privateKey: "...", sandbox: true)

var job1 = GengoJob()
job1.languagePair = GengoLanguagePair(
  source: GengoLanguage(code: "en"),
  target: GengoLanguage(code: "ja"),
  tier: GengoTier.Standard
)
job1.sourceText = "Testing Gengo API library calls."

var job2 = GengoJob()
job2.languagePair = GengoLanguagePair(
  source: GengoLanguage(code: "ja"),
  target: GengoLanguage(code: "en"),
  tier: GengoTier.Standard
)
job2.sourceText = "API呼出しのテスト"
job2.slug = "テストslug"

gengo.createJobs([job1, job2]) {order, error in
    switch order?.jobCount {
    case 0?:
        print("I ordered no jobs.")
    case 1?:
        print("I ordered 1 job.")
    case let count?:
        print("I ordered \(count) jobs.")
    default:
        print("job count is nil")
    }
}

The output will be:

I ordered 2 jobs.

The test code has a lot more usage examples.

Files

Dependencies

None.

About

A fully objectified client in Swift for the Gengo API

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published