phraseapp-ruby 1.6.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cb95d78fa26cd10cd443f2cb02ade6737275cfa0
4
- data.tar.gz: 6e8b139b40460e6d8eab82d5d53b8932555c8b4b
2
+ SHA256:
3
+ metadata.gz: d0d6e777bf8ba68f8697661617bab8eec04124a60e703ee9acd811f1da836507
4
+ data.tar.gz: f160717245c31cbd7a46a25ac834b51eaa877ba0cd7c928bf2301e5619b9d196
5
5
  SHA512:
6
- metadata.gz: 4ba23396f760e01b5a1c69b833efe5cf8bfd96a79c775dc38b13d31c60f0eb5a0e4e0e01f7c6fd1c997ce9f3b55f4e09c6d66a8821e0e5e45d9ad94c0c821fa2
7
- data.tar.gz: 0b19bde4677f07746658d76142e7f42ee362e407ab1cdd1d2ad853c7349eb582e84def0e18010d0df0462bc7a9dafe58439212760a9795affa61dd60347c0544
6
+ metadata.gz: 226bcc449ad14e906a385473c44d983e74df9361a467299ba224fd2d70966b8cb0188b53c1c6c7a9478fb6b21aa9346e743094e0c837dd79514eab829ffc8cdc
7
+ data.tar.gz: 8c0caa9f5b4d68cc9e682acbca822d3bff654c7027111f41abd431c54180ee20632293cd900cf34aeccae6deea206511328754cf12babe143de9c197b111e574
@@ -1,7 +1,7 @@
1
1
 
2
2
 
3
- # revision_docs:3b286cc04ceb2623aa3ab353520a23e1e72d83c3
4
- # revision_generator:e51df86b2d0cf519540791cefb4f6d24751d38b0
3
+ # revision_docs:af8c8e121b03fbb27f30326738fd1c3ac086b0a2
4
+ # revision_generator:HEAD/2018-08-10T154308/soenke
5
5
  require 'ostruct'
6
6
  require 'net/https'
7
7
  require 'uri'
@@ -37,6 +37,14 @@ module ResponseObjects
37
37
  end
38
38
  end
39
39
 
40
+ class AccountDetails < Account
41
+ #slug,
42
+ def initialize(hash)
43
+ super(hash)
44
+ PhraseApp.handle_times(self)
45
+ end
46
+ end
47
+
40
48
  class AffectedCount < ::OpenStruct
41
49
  #records_affected,
42
50
  def initialize(hash)
@@ -69,6 +77,22 @@ module ResponseObjects
69
77
  end
70
78
  end
71
79
 
80
+ class BitbucketSync < ::OpenStruct
81
+ #id, last_export_to_bitbucket_at, last_import_from_bitbucket_at, phraseapp_projects, repository_name, valid_phraseapp_yaml,
82
+ def initialize(hash)
83
+ super(hash)
84
+ PhraseApp.handle_times(self)
85
+ end
86
+ end
87
+
88
+ class BitbucketSyncExportResponse < ::OpenStruct
89
+ #status_path,
90
+ def initialize(hash)
91
+ super(hash)
92
+ PhraseApp.handle_times(self)
93
+ end
94
+ end
95
+
72
96
  class BlacklistedKey < ::OpenStruct
73
97
  #created_at, id, name, updated_at,
74
98
  def initialize(hash)
@@ -77,6 +101,14 @@ module ResponseObjects
77
101
  end
78
102
  end
79
103
 
104
+ class Branch < ::OpenStruct
105
+ #created_at, created_by, merged_at, merged_by, name, state, updated_at,
106
+ def initialize(hash)
107
+ super(hash)
108
+ PhraseApp.handle_times(self)
109
+ end
110
+ end
111
+
80
112
  class Comment < ::OpenStruct
81
113
  #created_at, id, message, updated_at, user,
82
114
  def initialize(hash)
@@ -206,7 +238,7 @@ module ResponseObjects
206
238
  end
207
239
 
208
240
  class Project < ::OpenStruct
209
- #account, created_at, id, main_format, name, updated_at,
241
+ #account, created_at, id, main_format, name, project_image_url, updated_at,
210
242
  def initialize(hash)
211
243
  super(hash)
212
244
  PhraseApp.handle_times(self)
@@ -214,7 +246,7 @@ module ResponseObjects
214
246
  end
215
247
 
216
248
  class ProjectDetails < Project
217
- #shares_translation_memory,
249
+ #shares_translation_memory, slug,
218
250
  def initialize(hash)
219
251
  super(hash)
220
252
  PhraseApp.handle_times(self)
@@ -326,7 +358,7 @@ module ResponseObjects
326
358
  end
327
359
 
328
360
  class TranslationKeyDetails < TranslationKey
329
- #comments_count, format_value_type, max_characters_allowed, name_plural, original_file, screenshot_url, unformatted, xml_space_preserve,
361
+ #comments_count, creator, format_value_type, max_characters_allowed, name_plural, original_file, screenshot_url, unformatted, xml_space_preserve,
330
362
  def initialize(hash)
331
363
  super(hash)
332
364
  PhraseApp.handle_times(self)
@@ -427,6 +459,25 @@ module RequestParams
427
459
  end
428
460
 
429
461
 
462
+ module RequestParams
463
+ # BitbucketSyncParams
464
+ # == Parameters:
465
+ # account_id::
466
+ # Account ID to specify the actual account the project should be created in. Required if the requesting user is a member of multiple accounts.
467
+ class BitbucketSyncParams < ::OpenStruct
468
+
469
+ def account_id=(val)
470
+ super(val)
471
+ end
472
+
473
+ def validate
474
+
475
+ end
476
+
477
+ end
478
+ end
479
+
480
+
430
481
  module RequestParams
431
482
  # BlacklistedKeyParams
432
483
  # == Parameters:
@@ -449,6 +500,28 @@ module RequestParams
449
500
  end
450
501
 
451
502
 
503
+ module RequestParams
504
+ # BranchParams
505
+ # == Parameters:
506
+ # name::
507
+ # Name of the branch
508
+ class BranchParams < ::OpenStruct
509
+
510
+ def name=(val)
511
+ super(val)
512
+ end
513
+
514
+ def validate
515
+
516
+ if name == nil || name == ""
517
+ raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"name\" of \"BranchParams\" not set")
518
+ end
519
+ end
520
+
521
+ end
522
+ end
523
+
524
+
452
525
  module RequestParams
453
526
  # CommentParams
454
527
  # == Parameters:
@@ -585,7 +658,7 @@ module RequestParams
585
658
  # locale_id::
586
659
  # locale id
587
660
  # user_ids::
588
- # Array of ids assigned to the JobLocale
661
+ # Array of user ids to be assigned to the job locale
589
662
  class JobLocaleParams < ::OpenStruct
590
663
 
591
664
  def locale_id=(val)
@@ -786,6 +859,10 @@ end
786
859
  module RequestParams
787
860
  # LocaleParams
788
861
  # == Parameters:
862
+ # autotranslate::
863
+ # If set, translations for this locale will be fetched automatically, right after creation.
864
+ # branch::
865
+ # specify the branch to use
789
866
  # code::
790
867
  # Locale ISO code
791
868
  # default::
@@ -804,6 +881,20 @@ module RequestParams
804
881
  # Indicates that updated translations for this locale should be marked as unverified. Part of the <a href="https://phraseapp.com/docs/guides/working-with-phraseapp/verification-proofreading" target="_blank">Advanced Workflows</a> feature and only available in <a href="https://phraseapp.com/pricing" target="_blank">Control Package</a>.
805
882
  class LocaleParams < ::OpenStruct
806
883
 
884
+ def autotranslate=(val)
885
+ if val.is_a?(TrueClass)
886
+ super(true)
887
+ elsif val.is_a?(FalseClass)
888
+ return
889
+ else
890
+ PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
891
+ end
892
+ end
893
+
894
+ def branch=(val)
895
+ super(val)
896
+ end
897
+
807
898
  def code=(val)
808
899
  super(val)
809
900
  end
@@ -884,7 +975,7 @@ module RequestParams
884
975
  # TranslationOrderParams
885
976
  # == Parameters:
886
977
  # category::
887
- # Category to use (required for orders processed by TextMaster). <a href="#categories">Category List</a>
978
+ # Category to use (required for orders processed by TextMaster).
888
979
  # include_untranslated_keys::
889
980
  # Order translations for keys with untranslated content in the selected target locales.
890
981
  # include_unverified_translations::
@@ -1022,9 +1113,13 @@ module RequestParams
1022
1113
  # account_id::
1023
1114
  # Account ID to specify the actual account the project should be created in. Required if the requesting user is a member of multiple accounts.
1024
1115
  # main_format::
1025
- # Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href="guides/formats/">Format Guide</a> or our <a href="https://api.phraseapp.com/api/v2/formats">Formats API Endpoint</a>.
1116
+ # Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see <a href="http://phraseapp.com/docs/guides/formats/">Format Guide</a> or our <a href="#formats">Formats API Endpoint</a>.
1026
1117
  # name::
1027
1118
  # Name of the project
1119
+ # project_image::
1120
+ # Image to identify the project
1121
+ # remove_project_image::
1122
+ # Indicates whether the project image should be deleted.
1028
1123
  # shares_translation_memory::
1029
1124
  # Indicates whether the project should share the account's translation memory
1030
1125
  class ProjectParams < ::OpenStruct
@@ -1041,6 +1136,20 @@ module RequestParams
1041
1136
  super(val)
1042
1137
  end
1043
1138
 
1139
+ def project_image=(val)
1140
+ super(val)
1141
+ end
1142
+
1143
+ def remove_project_image=(val)
1144
+ if val.is_a?(TrueClass)
1145
+ super(true)
1146
+ elsif val.is_a?(FalseClass)
1147
+ return
1148
+ else
1149
+ PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
1150
+ end
1151
+ end
1152
+
1044
1153
  def shares_translation_memory=(val)
1045
1154
  if val.is_a?(TrueClass)
1046
1155
  super(true)
@@ -1251,8 +1360,12 @@ end
1251
1360
  module RequestParams
1252
1361
  # UploadParams
1253
1362
  # == Parameters:
1363
+ # autotranslate::
1364
+ # If set, translations for the uploaded language will be fetched automatically.
1365
+ # branch::
1366
+ # specify the branch to use
1254
1367
  # convert_emoji::
1255
- # Indicates whether the file contains Emoji symbols that should be converted. <a href="guides/working-with-phraseapp/emoji-support/">Working with Emojis</a>.
1368
+ # Indicates whether the file contains Emoji symbols that should be converted. <a href="https://phraseapp.com/docs/guides/working-with-phraseapp/emoji-support/">Working with Emojis</a>.
1256
1369
  # file::
1257
1370
  # File to be imported
1258
1371
  # file_encoding::
@@ -1277,6 +1390,20 @@ module RequestParams
1277
1390
  # Indicates whether existing translations should be updated with the file content.
1278
1391
  class UploadParams < ::OpenStruct
1279
1392
 
1393
+ def autotranslate=(val)
1394
+ if val.is_a?(TrueClass)
1395
+ super(true)
1396
+ elsif val.is_a?(FalseClass)
1397
+ return
1398
+ else
1399
+ PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
1400
+ end
1401
+ end
1402
+
1403
+ def branch=(val)
1404
+ super(val)
1405
+ end
1406
+
1280
1407
  def convert_emoji=(val)
1281
1408
  if val.is_a?(TrueClass)
1282
1409
  super(true)
@@ -1458,6 +1585,25 @@ module PhraseApp
1458
1585
 
1459
1586
 
1460
1587
 
1588
+ module RequestParams
1589
+ # BranchMergeParams
1590
+ # == Parameters:
1591
+ # strategy::
1592
+ # strategy used for merge blocking, use_master or use_branch
1593
+ class BranchMergeParams < ::OpenStruct
1594
+
1595
+ def strategy=(val)
1596
+ super(val)
1597
+ end
1598
+
1599
+ def validate
1600
+
1601
+ end
1602
+
1603
+ end
1604
+ end
1605
+
1606
+
1461
1607
  module RequestParams
1462
1608
  # InvitationCreateParams
1463
1609
  # == Parameters:
@@ -1794,7 +1940,7 @@ module RequestParams
1794
1940
  # q::
1795
1941
  # q_description_placeholder
1796
1942
  # tags::
1797
- # Tag or comma-separated list of tags to add to the matching collection of keys
1943
+ # Tag or comma-separated list of tags to remove from the matching collection of keys
1798
1944
  class KeysUntagParams < ::OpenStruct
1799
1945
 
1800
1946
  def locale_id=(val)
@@ -1823,8 +1969,10 @@ end
1823
1969
  module RequestParams
1824
1970
  # LocaleDownloadParams
1825
1971
  # == Parameters:
1972
+ # branch::
1973
+ # specify the branch to use
1826
1974
  # convert_emoji::
1827
- # Indicates whether Emoji symbols should be converted to actual Emojis. <a href="guides/working-with-phraseapp/emoji-support/">Working with Emojis</a>.
1975
+ # Indicates whether Emoji symbols should be converted to actual Emojis. <a href="http://phraseapp.com/docs/guides/working-with-phraseapp/emoji-support/">Working with Emojis</a>.
1828
1976
  # encoding::
1829
1977
  # Enforces a specific encoding on the file contents. Valid options are "UTF-8", "UTF-16" and "ISO-8859-1".
1830
1978
  # fallback_locale_id::
@@ -1832,7 +1980,7 @@ module RequestParams
1832
1980
  # file_format::
1833
1981
  # File format name. See the format guide for all supported file formats.
1834
1982
  # format_options::
1835
- # Additional formatting and render options. See the <a href="guides/formats">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
1983
+ # Additional formatting and render options. See the <a href="http://phraseapp.com/docs/guides/formats">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
1836
1984
  # include_empty_translations::
1837
1985
  # Indicates whether keys without translations should be included in the output as well.
1838
1986
  # keep_notranslate_tags::
@@ -1843,6 +1991,10 @@ module RequestParams
1843
1991
  # Limit result to keys tagged with the given tag (identified by its name).
1844
1992
  class LocaleDownloadParams < ::OpenStruct
1845
1993
 
1994
+ def branch=(val)
1995
+ super(val)
1996
+ end
1997
+
1846
1998
  def convert_emoji=(val)
1847
1999
  if val.is_a?(TrueClass)
1848
2000
  super(true)
@@ -1914,6 +2066,44 @@ module RequestParams
1914
2066
  end
1915
2067
 
1916
2068
 
2069
+ module RequestParams
2070
+ # LocaleShowParams
2071
+ # == Parameters:
2072
+ # branch::
2073
+ # specify the branch to use
2074
+ class LocaleShowParams < ::OpenStruct
2075
+
2076
+ def branch=(val)
2077
+ super(val)
2078
+ end
2079
+
2080
+ def validate
2081
+
2082
+ end
2083
+
2084
+ end
2085
+ end
2086
+
2087
+
2088
+ module RequestParams
2089
+ # LocalesListParams
2090
+ # == Parameters:
2091
+ # branch::
2092
+ # specify the branch to use
2093
+ class LocalesListParams < ::OpenStruct
2094
+
2095
+ def branch=(val)
2096
+ super(val)
2097
+ end
2098
+
2099
+ def validate
2100
+
2101
+ end
2102
+
2103
+ end
2104
+ end
2105
+
2106
+
1917
2107
  module RequestParams
1918
2108
  # MemberUpdateParams
1919
2109
  # == Parameters:
@@ -2248,6 +2438,25 @@ module RequestParams
2248
2438
  end
2249
2439
 
2250
2440
 
2441
+ module RequestParams
2442
+ # UploadShowParams
2443
+ # == Parameters:
2444
+ # branch::
2445
+ # specify the branch to use
2446
+ class UploadShowParams < ::OpenStruct
2447
+
2448
+ def branch=(val)
2449
+ super(val)
2450
+ end
2451
+
2452
+ def validate
2453
+
2454
+ end
2455
+
2456
+ end
2457
+ end
2458
+
2459
+
2251
2460
  # Usage example:
2252
2461
  #
2253
2462
  # Require the gem
@@ -2270,13 +2479,13 @@ end
2270
2479
 
2271
2480
 
2272
2481
  # Get details on a single account.
2273
- # API Path: /v2/accounts/:id
2482
+ # API Path: /api/v2/accounts/:id
2274
2483
  # == Parameters:
2275
2484
  # id::
2276
2485
  # id
2277
2486
  #
2278
2487
  # == Returns:
2279
- # PhraseApp::ResponseObjects::Account
2488
+ # PhraseApp::ResponseObjects::AccountDetails
2280
2489
  # err
2281
2490
  def account_show(id)
2282
2491
  path = sprintf("/api/v2/accounts/%s", id)
@@ -2289,11 +2498,11 @@ end
2289
2498
  return nil, err
2290
2499
  end
2291
2500
 
2292
- return PhraseApp::ResponseObjects::Account.new(JSON.load(rc.body)), err
2501
+ return PhraseApp::ResponseObjects::AccountDetails.new(JSON.load(rc.body)), err
2293
2502
  end
2294
2503
 
2295
2504
  # List all accounts the current user has access to.
2296
- # API Path: /v2/accounts
2505
+ # API Path: /api/v2/accounts
2297
2506
  # == Parameters:
2298
2507
  #
2299
2508
  # == Returns:
@@ -2314,7 +2523,7 @@ end
2314
2523
  end
2315
2524
 
2316
2525
  # Create a new authorization.
2317
- # API Path: /v2/authorizations
2526
+ # API Path: /api/v2/authorizations
2318
2527
  # == Parameters:
2319
2528
  # params::
2320
2529
  # Parameters of type PhraseApp::RequestParams::AuthorizationParams
@@ -2348,7 +2557,7 @@ end
2348
2557
  end
2349
2558
 
2350
2559
  # Delete an existing authorization. API calls using that token will stop working.
2351
- # API Path: /v2/authorizations/:id
2560
+ # API Path: /api/v2/authorizations/:id
2352
2561
  # == Parameters:
2353
2562
  # id::
2354
2563
  # id
@@ -2370,7 +2579,7 @@ end
2370
2579
  end
2371
2580
 
2372
2581
  # Get details on a single authorization.
2373
- # API Path: /v2/authorizations/:id
2582
+ # API Path: /api/v2/authorizations/:id
2374
2583
  # == Parameters:
2375
2584
  # id::
2376
2585
  # id
@@ -2393,7 +2602,7 @@ end
2393
2602
  end
2394
2603
 
2395
2604
  # Update an existing authorization.
2396
- # API Path: /v2/authorizations/:id
2605
+ # API Path: /api/v2/authorizations/:id
2397
2606
  # == Parameters:
2398
2607
  # id::
2399
2608
  # id
@@ -2429,7 +2638,7 @@ end
2429
2638
  end
2430
2639
 
2431
2640
  # List all your authorizations.
2432
- # API Path: /v2/authorizations
2641
+ # API Path: /api/v2/authorizations
2433
2642
  # == Parameters:
2434
2643
  #
2435
2644
  # == Returns:
@@ -2449,8 +2658,113 @@ end
2449
2658
  return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::Authorization.new(item) }, err
2450
2659
  end
2451
2660
 
2661
+ # Export translations from PhraseApp to Bitbucket according to the .phraseapp.yml file within the Bitbucket Repository.
2662
+ # API Path: /api/v2/bitbucket_syncs/:id/export
2663
+ # == Parameters:
2664
+ # id::
2665
+ # id
2666
+ # params::
2667
+ # Parameters of type PhraseApp::RequestParams::BitbucketSyncParams
2668
+ #
2669
+ # == Returns:
2670
+ # PhraseApp::ResponseObjects::BitbucketSyncExportResponse
2671
+ # err
2672
+ def bitbucket_sync_export(id, params)
2673
+ path = sprintf("/api/v2/bitbucket_syncs/%s/export", id)
2674
+ data_hash = {}
2675
+ post_body = nil
2676
+
2677
+ if params.present?
2678
+ unless params.kind_of?(PhraseApp::RequestParams::BitbucketSyncParams)
2679
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BitbucketSyncParams")
2680
+ end
2681
+ end
2682
+
2683
+ data_hash = params.to_h
2684
+ err = params.validate
2685
+ if err != nil
2686
+ return nil, err
2687
+ end
2688
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
2689
+ rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 200)
2690
+ if err != nil
2691
+ return nil, err
2692
+ end
2693
+
2694
+ return PhraseApp::ResponseObjects::BitbucketSyncExportResponse.new(JSON.load(rc.body)), err
2695
+ end
2696
+
2697
+ # Import translations from Bitbucket to PhraseApp according to the .phraseapp.yml file within the Bitbucket repository.
2698
+ # API Path: /api/v2/bitbucket_syncs/:id/import
2699
+ # == Parameters:
2700
+ # id::
2701
+ # id
2702
+ # params::
2703
+ # Parameters of type PhraseApp::RequestParams::BitbucketSyncParams
2704
+ #
2705
+ # == Returns:
2706
+ # err
2707
+ def bitbucket_sync_import(id, params)
2708
+ path = sprintf("/api/v2/bitbucket_syncs/%s/import", id)
2709
+ data_hash = {}
2710
+ post_body = nil
2711
+
2712
+ if params.present?
2713
+ unless params.kind_of?(PhraseApp::RequestParams::BitbucketSyncParams)
2714
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BitbucketSyncParams")
2715
+ end
2716
+ end
2717
+
2718
+ data_hash = params.to_h
2719
+ err = params.validate
2720
+ if err != nil
2721
+ return nil, err
2722
+ end
2723
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
2724
+ rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 200)
2725
+ if err != nil
2726
+ return nil, err
2727
+ end
2728
+
2729
+ return err
2730
+ end
2731
+
2732
+ # List all Bitbucket repositories for which synchronisation with PhraseApp is activated.
2733
+ # API Path: /api/v2/bitbucket_syncs
2734
+ # == Parameters:
2735
+ # params::
2736
+ # Parameters of type PhraseApp::RequestParams::BitbucketSyncParams
2737
+ #
2738
+ # == Returns:
2739
+ # PhraseApp::ResponseObjects::BitbucketSync
2740
+ # err
2741
+ def bitbucket_syncs_list(page, per_page, params)
2742
+ path = sprintf("/api/v2/bitbucket_syncs")
2743
+ data_hash = {}
2744
+ post_body = nil
2745
+
2746
+ if params.present?
2747
+ unless params.kind_of?(PhraseApp::RequestParams::BitbucketSyncParams)
2748
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BitbucketSyncParams")
2749
+ end
2750
+ end
2751
+
2752
+ data_hash = params.to_h
2753
+ err = params.validate
2754
+ if err != nil
2755
+ return nil, err
2756
+ end
2757
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
2758
+ rc, err = PhraseApp.send_request_paginated(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200, page, per_page)
2759
+ if err != nil
2760
+ return nil, err
2761
+ end
2762
+
2763
+ return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::BitbucketSync.new(item) }, err
2764
+ end
2765
+
2452
2766
  # Create a new rule for blacklisting keys.
2453
- # API Path: /v2/projects/:project_id/blacklisted_keys
2767
+ # API Path: /api/v2/projects/:project_id/blacklisted_keys
2454
2768
  # == Parameters:
2455
2769
  # project_id::
2456
2770
  # project_id
@@ -2486,7 +2800,7 @@ end
2486
2800
  end
2487
2801
 
2488
2802
  # Delete an existing rule for blacklisting keys.
2489
- # API Path: /v2/projects/:project_id/blacklisted_keys/:id
2803
+ # API Path: /api/v2/projects/:project_id/blacklisted_keys/:id
2490
2804
  # == Parameters:
2491
2805
  # project_id::
2492
2806
  # project_id
@@ -2510,7 +2824,7 @@ end
2510
2824
  end
2511
2825
 
2512
2826
  # Get details on a single rule for blacklisting keys for a given project.
2513
- # API Path: /v2/projects/:project_id/blacklisted_keys/:id
2827
+ # API Path: /api/v2/projects/:project_id/blacklisted_keys/:id
2514
2828
  # == Parameters:
2515
2829
  # project_id::
2516
2830
  # project_id
@@ -2535,7 +2849,7 @@ end
2535
2849
  end
2536
2850
 
2537
2851
  # Update an existing rule for blacklisting keys.
2538
- # API Path: /v2/projects/:project_id/blacklisted_keys/:id
2852
+ # API Path: /api/v2/projects/:project_id/blacklisted_keys/:id
2539
2853
  # == Parameters:
2540
2854
  # project_id::
2541
2855
  # project_id
@@ -2573,7 +2887,7 @@ end
2573
2887
  end
2574
2888
 
2575
2889
  # List all rules for blacklisting keys for the given project.
2576
- # API Path: /v2/projects/:project_id/blacklisted_keys
2890
+ # API Path: /api/v2/projects/:project_id/blacklisted_keys
2577
2891
  # == Parameters:
2578
2892
  # project_id::
2579
2893
  # project_id
@@ -2595,8 +2909,191 @@ end
2595
2909
  return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::BlacklistedKey.new(item) }, err
2596
2910
  end
2597
2911
 
2912
+ # Create a new branch.
2913
+ # API Path: /api/v2/projects/:project_id/branches
2914
+ # == Parameters:
2915
+ # project_id::
2916
+ # project_id
2917
+ # params::
2918
+ # Parameters of type PhraseApp::RequestParams::BranchParams
2919
+ #
2920
+ # == Returns:
2921
+ # PhraseApp::ResponseObjects::Branch
2922
+ # err
2923
+ def branch_create(project_id, params)
2924
+ path = sprintf("/api/v2/projects/%s/branches", project_id)
2925
+ data_hash = {}
2926
+ post_body = nil
2927
+
2928
+ if params.present?
2929
+ unless params.kind_of?(PhraseApp::RequestParams::BranchParams)
2930
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BranchParams")
2931
+ end
2932
+ end
2933
+
2934
+ data_hash = params.to_h
2935
+ err = params.validate
2936
+ if err != nil
2937
+ return nil, err
2938
+ end
2939
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
2940
+ rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 201)
2941
+ if err != nil
2942
+ return nil, err
2943
+ end
2944
+
2945
+ return PhraseApp::ResponseObjects::Branch.new(JSON.load(rc.body)), err
2946
+ end
2947
+
2948
+ # Delete an existing branch.
2949
+ # API Path: /api/v2/projects/:project_id/branches/:id
2950
+ # == Parameters:
2951
+ # project_id::
2952
+ # project_id
2953
+ # id::
2954
+ # id
2955
+ #
2956
+ # == Returns:
2957
+ # err
2958
+ def branch_delete(project_id, id)
2959
+ path = sprintf("/api/v2/projects/%s/branches/%s", project_id, id)
2960
+ data_hash = {}
2961
+ post_body = nil
2962
+
2963
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
2964
+ rc, err = PhraseApp.send_request(@credentials, "DELETE", path, reqHelper.ctype, reqHelper.body, 204)
2965
+ if err != nil
2966
+ return nil, err
2967
+ end
2968
+
2969
+ return err
2970
+ end
2971
+
2972
+ # Merge an existing branch.
2973
+ # API Path: /api/v2/projects/:project_id/branches/:id/merge
2974
+ # == Parameters:
2975
+ # project_id::
2976
+ # project_id
2977
+ # id::
2978
+ # id
2979
+ # params::
2980
+ # Parameters of type PhraseApp::RequestParams::BranchMergeParams
2981
+ #
2982
+ # == Returns:
2983
+ # err
2984
+ def branch_merge(project_id, id, params)
2985
+ path = sprintf("/api/v2/projects/%s/branches/%s/merge", project_id, id)
2986
+ data_hash = {}
2987
+ post_body = nil
2988
+
2989
+ if params.present?
2990
+ unless params.kind_of?(PhraseApp::RequestParams::BranchMergeParams)
2991
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BranchMergeParams")
2992
+ end
2993
+ end
2994
+
2995
+ data_hash = params.to_h
2996
+ err = params.validate
2997
+ if err != nil
2998
+ return nil, err
2999
+ end
3000
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
3001
+ rc, err = PhraseApp.send_request(@credentials, "PATCH", path, reqHelper.ctype, reqHelper.body, 200)
3002
+ if err != nil
3003
+ return nil, err
3004
+ end
3005
+
3006
+ return err
3007
+ end
3008
+
3009
+ # Get details on a single branch for a given project.
3010
+ # API Path: /api/v2/projects/:project_id/branches/:id
3011
+ # == Parameters:
3012
+ # project_id::
3013
+ # project_id
3014
+ # id::
3015
+ # id
3016
+ #
3017
+ # == Returns:
3018
+ # PhraseApp::ResponseObjects::Branch
3019
+ # err
3020
+ def branch_show(project_id, id)
3021
+ path = sprintf("/api/v2/projects/%s/branches/%s", project_id, id)
3022
+ data_hash = {}
3023
+ post_body = nil
3024
+
3025
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
3026
+ rc, err = PhraseApp.send_request(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200)
3027
+ if err != nil
3028
+ return nil, err
3029
+ end
3030
+
3031
+ return PhraseApp::ResponseObjects::Branch.new(JSON.load(rc.body)), err
3032
+ end
3033
+
3034
+ # Update an existing branch.
3035
+ # API Path: /api/v2/projects/:project_id/branches/:id
3036
+ # == Parameters:
3037
+ # project_id::
3038
+ # project_id
3039
+ # id::
3040
+ # id
3041
+ # params::
3042
+ # Parameters of type PhraseApp::RequestParams::BranchParams
3043
+ #
3044
+ # == Returns:
3045
+ # PhraseApp::ResponseObjects::Branch
3046
+ # err
3047
+ def branch_update(project_id, id, params)
3048
+ path = sprintf("/api/v2/projects/%s/branches/%s", project_id, id)
3049
+ data_hash = {}
3050
+ post_body = nil
3051
+
3052
+ if params.present?
3053
+ unless params.kind_of?(PhraseApp::RequestParams::BranchParams)
3054
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::BranchParams")
3055
+ end
3056
+ end
3057
+
3058
+ data_hash = params.to_h
3059
+ err = params.validate
3060
+ if err != nil
3061
+ return nil, err
3062
+ end
3063
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
3064
+ rc, err = PhraseApp.send_request(@credentials, "PATCH", path, reqHelper.ctype, reqHelper.body, 200)
3065
+ if err != nil
3066
+ return nil, err
3067
+ end
3068
+
3069
+ return PhraseApp::ResponseObjects::Branch.new(JSON.load(rc.body)), err
3070
+ end
3071
+
3072
+ # List all branches the of the current project.
3073
+ # API Path: /api/v2/projects/:project_id/branches
3074
+ # == Parameters:
3075
+ # project_id::
3076
+ # project_id
3077
+ #
3078
+ # == Returns:
3079
+ # PhraseApp::ResponseObjects::Branch
3080
+ # err
3081
+ def branches_list(project_id, page, per_page)
3082
+ path = sprintf("/api/v2/projects/%s/branches", project_id)
3083
+ data_hash = {}
3084
+ post_body = nil
3085
+
3086
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
3087
+ rc, err = PhraseApp.send_request_paginated(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200, page, per_page)
3088
+ if err != nil
3089
+ return nil, err
3090
+ end
3091
+
3092
+ return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::Branch.new(item) }, err
3093
+ end
3094
+
2598
3095
  # Create a new comment for a key.
2599
- # API Path: /v2/projects/:project_id/keys/:key_id/comments
3096
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments
2600
3097
  # == Parameters:
2601
3098
  # project_id::
2602
3099
  # project_id
@@ -2634,7 +3131,7 @@ end
2634
3131
  end
2635
3132
 
2636
3133
  # Delete an existing comment.
2637
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id
3134
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id
2638
3135
  # == Parameters:
2639
3136
  # project_id::
2640
3137
  # project_id
@@ -2660,7 +3157,7 @@ end
2660
3157
  end
2661
3158
 
2662
3159
  # Check if comment was marked as read. Returns 204 if read, 404 if unread.
2663
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id/read
3160
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id/read
2664
3161
  # == Parameters:
2665
3162
  # project_id::
2666
3163
  # project_id
@@ -2686,7 +3183,7 @@ end
2686
3183
  end
2687
3184
 
2688
3185
  # Mark a comment as read.
2689
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id/read
3186
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id/read
2690
3187
  # == Parameters:
2691
3188
  # project_id::
2692
3189
  # project_id
@@ -2712,7 +3209,7 @@ end
2712
3209
  end
2713
3210
 
2714
3211
  # Mark a comment as unread.
2715
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id/read
3212
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id/read
2716
3213
  # == Parameters:
2717
3214
  # project_id::
2718
3215
  # project_id
@@ -2738,7 +3235,7 @@ end
2738
3235
  end
2739
3236
 
2740
3237
  # Get details on a single comment.
2741
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id
3238
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id
2742
3239
  # == Parameters:
2743
3240
  # project_id::
2744
3241
  # project_id
@@ -2765,7 +3262,7 @@ end
2765
3262
  end
2766
3263
 
2767
3264
  # Update an existing comment.
2768
- # API Path: /v2/projects/:project_id/keys/:key_id/comments/:id
3265
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments/:id
2769
3266
  # == Parameters:
2770
3267
  # project_id::
2771
3268
  # project_id
@@ -2805,7 +3302,7 @@ end
2805
3302
  end
2806
3303
 
2807
3304
  # List all comments for a key.
2808
- # API Path: /v2/projects/:project_id/keys/:key_id/comments
3305
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/comments
2809
3306
  # == Parameters:
2810
3307
  # project_id::
2811
3308
  # project_id
@@ -2830,7 +3327,7 @@ end
2830
3327
  end
2831
3328
 
2832
3329
  # Get a handy list of all localization file formats supported in PhraseApp.
2833
- # API Path: /v2/formats
3330
+ # API Path: /api/v2/formats
2834
3331
  # == Parameters:
2835
3332
  #
2836
3333
  # == Returns:
@@ -2851,7 +3348,7 @@ end
2851
3348
  end
2852
3349
 
2853
3350
  # List all glossaries the current user has access to.
2854
- # API Path: /v2/accounts/:account_id/glossaries
3351
+ # API Path: /api/v2/accounts/:account_id/glossaries
2855
3352
  # == Parameters:
2856
3353
  # account_id::
2857
3354
  # account_id
@@ -2874,7 +3371,7 @@ end
2874
3371
  end
2875
3372
 
2876
3373
  # Create a new glossary.
2877
- # API Path: /v2/accounts/:account_id/glossaries
3374
+ # API Path: /api/v2/accounts/:account_id/glossaries
2878
3375
  # == Parameters:
2879
3376
  # account_id::
2880
3377
  # account_id
@@ -2910,7 +3407,7 @@ end
2910
3407
  end
2911
3408
 
2912
3409
  # Delete an existing glossary.
2913
- # API Path: /v2/accounts/:account_id/glossaries/:id
3410
+ # API Path: /api/v2/accounts/:account_id/glossaries/:id
2914
3411
  # == Parameters:
2915
3412
  # account_id::
2916
3413
  # account_id
@@ -2934,7 +3431,7 @@ end
2934
3431
  end
2935
3432
 
2936
3433
  # Get details on a single glossary.
2937
- # API Path: /v2/accounts/:account_id/glossaries/:id
3434
+ # API Path: /api/v2/accounts/:account_id/glossaries/:id
2938
3435
  # == Parameters:
2939
3436
  # account_id::
2940
3437
  # account_id
@@ -2959,7 +3456,7 @@ end
2959
3456
  end
2960
3457
 
2961
3458
  # Update an existing glossary.
2962
- # API Path: /v2/accounts/:account_id/glossaries/:id
3459
+ # API Path: /api/v2/accounts/:account_id/glossaries/:id
2963
3460
  # == Parameters:
2964
3461
  # account_id::
2965
3462
  # account_id
@@ -2997,7 +3494,7 @@ end
2997
3494
  end
2998
3495
 
2999
3496
  # Create a new glossary term.
3000
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms
3497
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms
3001
3498
  # == Parameters:
3002
3499
  # account_id::
3003
3500
  # account_id
@@ -3035,7 +3532,7 @@ end
3035
3532
  end
3036
3533
 
3037
3534
  # Delete an existing glossary term.
3038
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3535
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3039
3536
  # == Parameters:
3040
3537
  # account_id::
3041
3538
  # account_id
@@ -3061,7 +3558,7 @@ end
3061
3558
  end
3062
3559
 
3063
3560
  # Get details on a single glossary term.
3064
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3561
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3065
3562
  # == Parameters:
3066
3563
  # account_id::
3067
3564
  # account_id
@@ -3088,7 +3585,7 @@ end
3088
3585
  end
3089
3586
 
3090
3587
  # Update an existing glossary term.
3091
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3588
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:id
3092
3589
  # == Parameters:
3093
3590
  # account_id::
3094
3591
  # account_id
@@ -3128,7 +3625,7 @@ end
3128
3625
  end
3129
3626
 
3130
3627
  # Create a new glossary term translation.
3131
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations
3628
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations
3132
3629
  # == Parameters:
3133
3630
  # account_id::
3134
3631
  # account_id
@@ -3168,7 +3665,7 @@ end
3168
3665
  end
3169
3666
 
3170
3667
  # Delete an existing glossary term translation.
3171
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations/:id
3668
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations/:id
3172
3669
  # == Parameters:
3173
3670
  # account_id::
3174
3671
  # account_id
@@ -3196,7 +3693,7 @@ end
3196
3693
  end
3197
3694
 
3198
3695
  # Update an existing glossary term translation.
3199
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations/:id
3696
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms/:term_id/translations/:id
3200
3697
  # == Parameters:
3201
3698
  # account_id::
3202
3699
  # account_id
@@ -3238,7 +3735,7 @@ end
3238
3735
  end
3239
3736
 
3240
3737
  # List all glossary terms the current user has access to.
3241
- # API Path: /v2/accounts/:account_id/glossaries/:glossary_id/terms
3738
+ # API Path: /api/v2/accounts/:account_id/glossaries/:glossary_id/terms
3242
3739
  # == Parameters:
3243
3740
  # account_id::
3244
3741
  # account_id
@@ -3263,7 +3760,7 @@ end
3263
3760
  end
3264
3761
 
3265
3762
  # Invite a person to an account. Developers and translators need <code>project_ids</code> and <code>locale_ids</code> assigned to access them. Access token scope must include <code>team.manage</code>.
3266
- # API Path: /v2/accounts/:account_id/invitations
3763
+ # API Path: /api/v2/accounts/:account_id/invitations
3267
3764
  # == Parameters:
3268
3765
  # account_id::
3269
3766
  # account_id
@@ -3299,7 +3796,7 @@ end
3299
3796
  end
3300
3797
 
3301
3798
  # Delete an existing invitation (must not be accepted yet). Access token scope must include <code>team.manage</code>.
3302
- # API Path: /v2/accounts/:account_id/invitations/:id
3799
+ # API Path: /api/v2/accounts/:account_id/invitations/:id
3303
3800
  # == Parameters:
3304
3801
  # account_id::
3305
3802
  # account_id
@@ -3323,7 +3820,7 @@ end
3323
3820
  end
3324
3821
 
3325
3822
  # Resend the invitation email (must not be accepted yet). Access token scope must include <code>team.manage</code>.
3326
- # API Path: /v2/accounts/:account_id/invitations/:id/resend
3823
+ # API Path: /api/v2/accounts/:account_id/invitations/:id/resend
3327
3824
  # == Parameters:
3328
3825
  # account_id::
3329
3826
  # account_id
@@ -3348,7 +3845,7 @@ end
3348
3845
  end
3349
3846
 
3350
3847
  # Get details on a single invitation. Access token scope must include <code>team.manage</code>.
3351
- # API Path: /v2/accounts/:account_id/invitations/:id
3848
+ # API Path: /api/v2/accounts/:account_id/invitations/:id
3352
3849
  # == Parameters:
3353
3850
  # account_id::
3354
3851
  # account_id
@@ -3373,7 +3870,7 @@ end
3373
3870
  end
3374
3871
 
3375
3872
  # Update an existing invitation (must not be accepted yet). The <code>email</code> cannot be updated. Developers and translators need <code>project_ids</code> and <code>locale_ids</code> assigned to access them. Access token scope must include <code>team.manage</code>.
3376
- # API Path: /v2/accounts/:account_id/invitations/:id
3873
+ # API Path: /api/v2/accounts/:account_id/invitations/:id
3377
3874
  # == Parameters:
3378
3875
  # account_id::
3379
3876
  # account_id
@@ -3411,7 +3908,7 @@ end
3411
3908
  end
3412
3909
 
3413
3910
  # List invitations for an account. It will also list the accessible resources like projects and locales the invited user has access to. In case nothing is shown the default access from the role is used. Access token scope must include <code>team.manage</code>.
3414
- # API Path: /v2/accounts/:account_id/invitations
3911
+ # API Path: /api/v2/accounts/:account_id/invitations
3415
3912
  # == Parameters:
3416
3913
  # account_id::
3417
3914
  # account_id
@@ -3434,7 +3931,7 @@ end
3434
3931
  end
3435
3932
 
3436
3933
  # Mark a job as completed.
3437
- # API Path: /v2/projects/:project_id/jobs/:id/complete
3934
+ # API Path: /api/v2/projects/:project_id/jobs/:id/complete
3438
3935
  # == Parameters:
3439
3936
  # project_id::
3440
3937
  # project_id
@@ -3459,7 +3956,7 @@ end
3459
3956
  end
3460
3957
 
3461
3958
  # Create a new job.
3462
- # API Path: /v2/projects/:project_id/jobs
3959
+ # API Path: /api/v2/projects/:project_id/jobs
3463
3960
  # == Parameters:
3464
3961
  # project_id::
3465
3962
  # project_id
@@ -3495,7 +3992,7 @@ end
3495
3992
  end
3496
3993
 
3497
3994
  # Delete an existing job.
3498
- # API Path: /v2/projects/:project_id/jobs/:id
3995
+ # API Path: /api/v2/projects/:project_id/jobs/:id
3499
3996
  # == Parameters:
3500
3997
  # project_id::
3501
3998
  # project_id
@@ -3519,7 +4016,7 @@ end
3519
4016
  end
3520
4017
 
3521
4018
  # Add multiple keys to a existing job.
3522
- # API Path: /v2/projects/:project_id/jobs/:id/keys
4019
+ # API Path: /api/v2/projects/:project_id/jobs/:id/keys
3523
4020
  # == Parameters:
3524
4021
  # project_id::
3525
4022
  # project_id
@@ -3557,7 +4054,7 @@ end
3557
4054
  end
3558
4055
 
3559
4056
  # Remove multiple keys from existing job.
3560
- # API Path: /v2/projects/:project_id/jobs/:id/keys
4057
+ # API Path: /api/v2/projects/:project_id/jobs/:id/keys
3561
4058
  # == Parameters:
3562
4059
  # project_id::
3563
4060
  # project_id
@@ -3593,8 +4090,33 @@ end
3593
4090
  return err
3594
4091
  end
3595
4092
 
4093
+ # Mark a job as uncompleted.
4094
+ # API Path: /api/v2/projects/:project_id/jobs/:id/reopen
4095
+ # == Parameters:
4096
+ # project_id::
4097
+ # project_id
4098
+ # id::
4099
+ # id
4100
+ #
4101
+ # == Returns:
4102
+ # PhraseApp::ResponseObjects::JobDetails
4103
+ # err
4104
+ def job_reopen(project_id, id)
4105
+ path = sprintf("/api/v2/projects/%s/jobs/%s/reopen", project_id, id)
4106
+ data_hash = {}
4107
+ post_body = nil
4108
+
4109
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4110
+ rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 200)
4111
+ if err != nil
4112
+ return nil, err
4113
+ end
4114
+
4115
+ return PhraseApp::ResponseObjects::JobDetails.new(JSON.load(rc.body)), err
4116
+ end
4117
+
3596
4118
  # Get details on a single job for a given project.
3597
- # API Path: /v2/projects/:project_id/jobs/:id
4119
+ # API Path: /api/v2/projects/:project_id/jobs/:id
3598
4120
  # == Parameters:
3599
4121
  # project_id::
3600
4122
  # project_id
@@ -3619,7 +4141,7 @@ end
3619
4141
  end
3620
4142
 
3621
4143
  # Starts an existing job in state draft.
3622
- # API Path: /v2/projects/:project_id/jobs/:id/start
4144
+ # API Path: /api/v2/projects/:project_id/jobs/:id/start
3623
4145
  # == Parameters:
3624
4146
  # project_id::
3625
4147
  # project_id
@@ -3644,7 +4166,7 @@ end
3644
4166
  end
3645
4167
 
3646
4168
  # Update an existing job.
3647
- # API Path: /v2/projects/:project_id/jobs/:id
4169
+ # API Path: /api/v2/projects/:project_id/jobs/:id
3648
4170
  # == Parameters:
3649
4171
  # project_id::
3650
4172
  # project_id
@@ -3681,19 +4203,21 @@ end
3681
4203
  return PhraseApp::ResponseObjects::JobDetails.new(JSON.load(rc.body)), err
3682
4204
  end
3683
4205
 
3684
- # Mark a JobLocale as completed.
3685
- # API Path: /v2/projects/:project_id/jobs/:id/complete
4206
+ # Mark a job locale as completed.
4207
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales/:id/complete
3686
4208
  # == Parameters:
3687
4209
  # project_id::
3688
4210
  # project_id
4211
+ # job_id::
4212
+ # job_id
3689
4213
  # id::
3690
4214
  # id
3691
4215
  #
3692
4216
  # == Returns:
3693
4217
  # PhraseApp::ResponseObjects::JobLocale
3694
4218
  # err
3695
- def job_locale_complete(project_id, id)
3696
- path = sprintf("/api/v2/projects/%s/jobs/%s/complete", project_id, id)
4219
+ def job_locale_complete(project_id, job_id, id)
4220
+ path = sprintf("/api/v2/projects/%s/jobs/%s/locales/%s/complete", project_id, job_id, id)
3697
4221
  data_hash = {}
3698
4222
  post_body = nil
3699
4223
 
@@ -3706,8 +4230,8 @@ end
3706
4230
  return PhraseApp::ResponseObjects::JobLocale.new(JSON.load(rc.body)), err
3707
4231
  end
3708
4232
 
3709
- # Delete an existing JobLocale.
3710
- # API Path: /v2/projects/:project_id/jobs/:job_id/locale/:id
4233
+ # Delete an existing job locale.
4234
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales/:id
3711
4235
  # == Parameters:
3712
4236
  # project_id::
3713
4237
  # project_id
@@ -3719,7 +4243,7 @@ end
3719
4243
  # == Returns:
3720
4244
  # err
3721
4245
  def job_locale_delete(project_id, job_id, id)
3722
- path = sprintf("/api/v2/projects/%s/jobs/%s/locale/%s", project_id, job_id, id)
4246
+ path = sprintf("/api/v2/projects/%s/jobs/%s/locales/%s", project_id, job_id, id)
3723
4247
  data_hash = {}
3724
4248
  post_body = nil
3725
4249
 
@@ -3732,8 +4256,35 @@ end
3732
4256
  return err
3733
4257
  end
3734
4258
 
3735
- # Get a single JobLocale for a given job.
3736
- # API Path: /v2/projects/:project_id/jobs/:job_id/locale/:id
4259
+ # Mark a job locale as uncompleted.
4260
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales/:id/reopen
4261
+ # == Parameters:
4262
+ # project_id::
4263
+ # project_id
4264
+ # job_id::
4265
+ # job_id
4266
+ # id::
4267
+ # id
4268
+ #
4269
+ # == Returns:
4270
+ # PhraseApp::ResponseObjects::JobLocale
4271
+ # err
4272
+ def job_locale_reopen(project_id, job_id, id)
4273
+ path = sprintf("/api/v2/projects/%s/jobs/%s/locales/%s/reopen", project_id, job_id, id)
4274
+ data_hash = {}
4275
+ post_body = nil
4276
+
4277
+ reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4278
+ rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 200)
4279
+ if err != nil
4280
+ return nil, err
4281
+ end
4282
+
4283
+ return PhraseApp::ResponseObjects::JobLocale.new(JSON.load(rc.body)), err
4284
+ end
4285
+
4286
+ # Get a single job locale for a given job.
4287
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locale/:id
3737
4288
  # == Parameters:
3738
4289
  # project_id::
3739
4290
  # project_id
@@ -3759,8 +4310,8 @@ end
3759
4310
  return PhraseApp::ResponseObjects::JobLocale.new(JSON.load(rc.body)), err
3760
4311
  end
3761
4312
 
3762
- # Update an existing job.
3763
- # API Path: /v2/projects/:project_id/jobs/:job_id/locales/:id
4313
+ # Update an existing job locale.
4314
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales/:id
3764
4315
  # == Parameters:
3765
4316
  # project_id::
3766
4317
  # project_id
@@ -3799,8 +4350,8 @@ end
3799
4350
  return PhraseApp::ResponseObjects::JobLocale.new(JSON.load(rc.body)), err
3800
4351
  end
3801
4352
 
3802
- # Create a new JobLocale.
3803
- # API Path: /v2/projects/:project_id/jobs/:job_id/locales
4353
+ # Create a new job locale.
4354
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales
3804
4355
  # == Parameters:
3805
4356
  # project_id::
3806
4357
  # project_id
@@ -3837,8 +4388,8 @@ end
3837
4388
  return PhraseApp::ResponseObjects::JobLocale.new(JSON.load(rc.body)), err
3838
4389
  end
3839
4390
 
3840
- # List all JobLocales for a given job.
3841
- # API Path: /v2/projects/:project_id/jobs/:job_id/locales
4391
+ # List all job locales for a given job.
4392
+ # API Path: /api/v2/projects/:project_id/jobs/:job_id/locales
3842
4393
  # == Parameters:
3843
4394
  # project_id::
3844
4395
  # project_id
@@ -3863,7 +4414,7 @@ end
3863
4414
  end
3864
4415
 
3865
4416
  # List all jobs for the given project.
3866
- # API Path: /v2/projects/:project_id/jobs
4417
+ # API Path: /api/v2/projects/:project_id/jobs
3867
4418
  # == Parameters:
3868
4419
  # project_id::
3869
4420
  # project_id
@@ -3899,7 +4450,7 @@ end
3899
4450
  end
3900
4451
 
3901
4452
  # Create a new key.
3902
- # API Path: /v2/projects/:project_id/keys
4453
+ # API Path: /api/v2/projects/:project_id/keys
3903
4454
  # == Parameters:
3904
4455
  # project_id::
3905
4456
  # project_id
@@ -3993,7 +4544,7 @@ end
3993
4544
  end
3994
4545
 
3995
4546
  # Delete an existing key.
3996
- # API Path: /v2/projects/:project_id/keys/:id
4547
+ # API Path: /api/v2/projects/:project_id/keys/:id
3997
4548
  # == Parameters:
3998
4549
  # project_id::
3999
4550
  # project_id
@@ -4017,7 +4568,7 @@ end
4017
4568
  end
4018
4569
 
4019
4570
  # Get details on a single key for a given project.
4020
- # API Path: /v2/projects/:project_id/keys/:id
4571
+ # API Path: /api/v2/projects/:project_id/keys/:id
4021
4572
  # == Parameters:
4022
4573
  # project_id::
4023
4574
  # project_id
@@ -4042,7 +4593,7 @@ end
4042
4593
  end
4043
4594
 
4044
4595
  # Update an existing key.
4045
- # API Path: /v2/projects/:project_id/keys/:id
4596
+ # API Path: /api/v2/projects/:project_id/keys/:id
4046
4597
  # == Parameters:
4047
4598
  # project_id::
4048
4599
  # project_id
@@ -4138,7 +4689,7 @@ end
4138
4689
  end
4139
4690
 
4140
4691
  # Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.
4141
- # API Path: /v2/projects/:project_id/keys
4692
+ # API Path: /api/v2/projects/:project_id/keys
4142
4693
  # == Parameters:
4143
4694
  # project_id::
4144
4695
  # project_id
@@ -4174,7 +4725,7 @@ end
4174
4725
  end
4175
4726
 
4176
4727
  # List all keys for the given project. Alternatively you can POST requests to /search.
4177
- # API Path: /v2/projects/:project_id/keys
4728
+ # API Path: /api/v2/projects/:project_id/keys
4178
4729
  # == Parameters:
4179
4730
  # project_id::
4180
4731
  # project_id
@@ -4210,7 +4761,7 @@ end
4210
4761
  end
4211
4762
 
4212
4763
  # Search keys for the given project matching query.
4213
- # API Path: /v2/projects/:project_id/keys/search
4764
+ # API Path: /api/v2/projects/:project_id/keys/search
4214
4765
  # == Parameters:
4215
4766
  # project_id::
4216
4767
  # project_id
@@ -4246,7 +4797,7 @@ end
4246
4797
  end
4247
4798
 
4248
4799
  # Tags all keys matching query. Same constraints as list.
4249
- # API Path: /v2/projects/:project_id/keys/tag
4800
+ # API Path: /api/v2/projects/:project_id/keys/tag
4250
4801
  # == Parameters:
4251
4802
  # project_id::
4252
4803
  # project_id
@@ -4282,7 +4833,7 @@ end
4282
4833
  end
4283
4834
 
4284
4835
  # Removes specified tags from keys matching query.
4285
- # API Path: /v2/projects/:project_id/keys/untag
4836
+ # API Path: /api/v2/projects/:project_id/keys/untag
4286
4837
  # == Parameters:
4287
4838
  # project_id::
4288
4839
  # project_id
@@ -4318,7 +4869,7 @@ end
4318
4869
  end
4319
4870
 
4320
4871
  # Create a new locale.
4321
- # API Path: /v2/projects/:project_id/locales
4872
+ # API Path: /api/v2/projects/:project_id/locales
4322
4873
  # == Parameters:
4323
4874
  # project_id::
4324
4875
  # project_id
@@ -4354,7 +4905,7 @@ end
4354
4905
  end
4355
4906
 
4356
4907
  # Delete an existing locale.
4357
- # API Path: /v2/projects/:project_id/locales/:id
4908
+ # API Path: /api/v2/projects/:project_id/locales/:id
4358
4909
  # == Parameters:
4359
4910
  # project_id::
4360
4911
  # project_id
@@ -4378,7 +4929,7 @@ end
4378
4929
  end
4379
4930
 
4380
4931
  # Download a locale in a specific file format.
4381
- # API Path: /v2/projects/:project_id/locales/:id/download
4932
+ # API Path: /api/v2/projects/:project_id/locales/:id/download
4382
4933
  # == Parameters:
4383
4934
  # project_id::
4384
4935
  # project_id
@@ -4415,21 +4966,34 @@ end
4415
4966
  end
4416
4967
 
4417
4968
  # Get details on a single locale for a given project.
4418
- # API Path: /v2/projects/:project_id/locales/:id
4969
+ # API Path: /api/v2/projects/:project_id/locales/:id
4419
4970
  # == Parameters:
4420
4971
  # project_id::
4421
4972
  # project_id
4422
4973
  # id::
4423
4974
  # id
4975
+ # params::
4976
+ # Parameters of type PhraseApp::RequestParams::LocaleShowParams
4424
4977
  #
4425
4978
  # == Returns:
4426
4979
  # PhraseApp::ResponseObjects::LocaleDetails
4427
4980
  # err
4428
- def locale_show(project_id, id)
4981
+ def locale_show(project_id, id, params)
4429
4982
  path = sprintf("/api/v2/projects/%s/locales/%s", project_id, id)
4430
4983
  data_hash = {}
4431
4984
  post_body = nil
4432
4985
 
4986
+ if params.present?
4987
+ unless params.kind_of?(PhraseApp::RequestParams::LocaleShowParams)
4988
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::LocaleShowParams")
4989
+ end
4990
+ end
4991
+
4992
+ data_hash = params.to_h
4993
+ err = params.validate
4994
+ if err != nil
4995
+ return nil, err
4996
+ end
4433
4997
  reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4434
4998
  rc, err = PhraseApp.send_request(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200)
4435
4999
  if err != nil
@@ -4440,7 +5004,7 @@ end
4440
5004
  end
4441
5005
 
4442
5006
  # Update an existing locale.
4443
- # API Path: /v2/projects/:project_id/locales/:id
5007
+ # API Path: /api/v2/projects/:project_id/locales/:id
4444
5008
  # == Parameters:
4445
5009
  # project_id::
4446
5010
  # project_id
@@ -4478,19 +5042,32 @@ end
4478
5042
  end
4479
5043
 
4480
5044
  # List all locales for the given project.
4481
- # API Path: /v2/projects/:project_id/locales
5045
+ # API Path: /api/v2/projects/:project_id/locales
4482
5046
  # == Parameters:
4483
5047
  # project_id::
4484
5048
  # project_id
5049
+ # params::
5050
+ # Parameters of type PhraseApp::RequestParams::LocalesListParams
4485
5051
  #
4486
5052
  # == Returns:
4487
5053
  # PhraseApp::ResponseObjects::Locale
4488
5054
  # err
4489
- def locales_list(project_id, page, per_page)
5055
+ def locales_list(project_id, page, per_page, params)
4490
5056
  path = sprintf("/api/v2/projects/%s/locales", project_id)
4491
5057
  data_hash = {}
4492
5058
  post_body = nil
4493
5059
 
5060
+ if params.present?
5061
+ unless params.kind_of?(PhraseApp::RequestParams::LocalesListParams)
5062
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::LocalesListParams")
5063
+ end
5064
+ end
5065
+
5066
+ data_hash = params.to_h
5067
+ err = params.validate
5068
+ if err != nil
5069
+ return nil, err
5070
+ end
4494
5071
  reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4495
5072
  rc, err = PhraseApp.send_request_paginated(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200, page, per_page)
4496
5073
  if err != nil
@@ -4501,7 +5078,7 @@ end
4501
5078
  end
4502
5079
 
4503
5080
  # Remove a user from the account. The user will be removed from the account but not deleted from PhraseApp. Access token scope must include <code>team.manage</code>.
4504
- # API Path: /v2/accounts/:account_id/members/:id
5081
+ # API Path: /api/v2/accounts/:account_id/members/:id
4505
5082
  # == Parameters:
4506
5083
  # account_id::
4507
5084
  # account_id
@@ -4525,7 +5102,7 @@ end
4525
5102
  end
4526
5103
 
4527
5104
  # Get details on a single user in the account. Access token scope must include <code>team.manage</code>.
4528
- # API Path: /v2/accounts/:account_id/members/:id
5105
+ # API Path: /api/v2/accounts/:account_id/members/:id
4529
5106
  # == Parameters:
4530
5107
  # account_id::
4531
5108
  # account_id
@@ -4550,7 +5127,7 @@ end
4550
5127
  end
4551
5128
 
4552
5129
  # Update user permissions in the account. Developers and translators need <code>project_ids</code> and <code>locale_ids</code> assigned to access them. Access token scope must include <code>team.manage</code>.
4553
- # API Path: /v2/accounts/:account_id/members/:id
5130
+ # API Path: /api/v2/accounts/:account_id/members/:id
4554
5131
  # == Parameters:
4555
5132
  # account_id::
4556
5133
  # account_id
@@ -4588,7 +5165,7 @@ end
4588
5165
  end
4589
5166
 
4590
5167
  # Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include <code>team.manage</code>.
4591
- # API Path: /v2/accounts/:account_id/members
5168
+ # API Path: /api/v2/accounts/:account_id/members
4592
5169
  # == Parameters:
4593
5170
  # account_id::
4594
5171
  # account_id
@@ -4611,7 +5188,7 @@ end
4611
5188
  end
4612
5189
 
4613
5190
  # Confirm an existing order and send it to the provider for translation. Same constraints as for create.
4614
- # API Path: /v2/projects/:project_id/orders/:id/confirm
5191
+ # API Path: /api/v2/projects/:project_id/orders/:id/confirm
4615
5192
  # == Parameters:
4616
5193
  # project_id::
4617
5194
  # project_id
@@ -4636,7 +5213,7 @@ end
4636
5213
  end
4637
5214
 
4638
5215
  # Create a new order. Access token scope must include <code>orders.create</code>.
4639
- # API Path: /v2/projects/:project_id/orders
5216
+ # API Path: /api/v2/projects/:project_id/orders
4640
5217
  # == Parameters:
4641
5218
  # project_id::
4642
5219
  # project_id
@@ -4672,7 +5249,7 @@ end
4672
5249
  end
4673
5250
 
4674
5251
  # Cancel an existing order. Must not yet be confirmed.
4675
- # API Path: /v2/projects/:project_id/orders/:id
5252
+ # API Path: /api/v2/projects/:project_id/orders/:id
4676
5253
  # == Parameters:
4677
5254
  # project_id::
4678
5255
  # project_id
@@ -4696,7 +5273,7 @@ end
4696
5273
  end
4697
5274
 
4698
5275
  # Get details on a single order.
4699
- # API Path: /v2/projects/:project_id/orders/:id
5276
+ # API Path: /api/v2/projects/:project_id/orders/:id
4700
5277
  # == Parameters:
4701
5278
  # project_id::
4702
5279
  # project_id
@@ -4721,7 +5298,7 @@ end
4721
5298
  end
4722
5299
 
4723
5300
  # List all orders for the given project.
4724
- # API Path: /v2/projects/:project_id/orders
5301
+ # API Path: /api/v2/projects/:project_id/orders
4725
5302
  # == Parameters:
4726
5303
  # project_id::
4727
5304
  # project_id
@@ -4744,7 +5321,7 @@ end
4744
5321
  end
4745
5322
 
4746
5323
  # Create a new project.
4747
- # API Path: /v2/projects
5324
+ # API Path: /api/v2/projects
4748
5325
  # == Parameters:
4749
5326
  # params::
4750
5327
  # Parameters of type PhraseApp::RequestParams::ProjectParams
@@ -4762,12 +5339,38 @@ end
4762
5339
  raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::ProjectParams")
4763
5340
  end
4764
5341
  end
4765
-
4766
- data_hash = params.to_h
4767
- err = params.validate
4768
- if err != nil
4769
- return nil, err
5342
+ if params.account_id != nil
5343
+ data_hash["account_id"] = params.account_id
5344
+ end
5345
+
5346
+ if params.main_format != nil
5347
+ data_hash["main_format"] = params.main_format
5348
+ end
5349
+
5350
+ if params.name != nil
5351
+ data_hash["name"] = params.name
5352
+ end
5353
+
5354
+ if params.project_image != nil
5355
+ post_body = []
5356
+ post_body << "--#{PhraseApp::MULTIPART_BOUNDARY}\r\n"
5357
+ post_body << "Content-Disposition: form-data; name=\"project_image\"; filename=\"#{File.basename(params.project_image )}\"\r\n"
5358
+ post_body << "Content-Type: text/plain\r\n"
5359
+ post_body << "\r\n"
5360
+ post_body << File.read(params.project_image)
5361
+ post_body << "\r\n"
5362
+ end
5363
+
5364
+ if params.remove_project_image != nil
5365
+ data_hash["remove_project_image"] = (params.remove_project_image == true)
4770
5366
  end
5367
+
5368
+ if params.shares_translation_memory != nil
5369
+ data_hash["shares_translation_memory"] = (params.shares_translation_memory == true)
5370
+ end
5371
+
5372
+
5373
+
4771
5374
  reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4772
5375
  rc, err = PhraseApp.send_request(@credentials, "POST", path, reqHelper.ctype, reqHelper.body, 201)
4773
5376
  if err != nil
@@ -4778,7 +5381,7 @@ end
4778
5381
  end
4779
5382
 
4780
5383
  # Delete an existing project.
4781
- # API Path: /v2/projects/:id
5384
+ # API Path: /api/v2/projects/:id
4782
5385
  # == Parameters:
4783
5386
  # id::
4784
5387
  # id
@@ -4800,7 +5403,7 @@ end
4800
5403
  end
4801
5404
 
4802
5405
  # Get details on a single project.
4803
- # API Path: /v2/projects/:id
5406
+ # API Path: /api/v2/projects/:id
4804
5407
  # == Parameters:
4805
5408
  # id::
4806
5409
  # id
@@ -4823,7 +5426,7 @@ end
4823
5426
  end
4824
5427
 
4825
5428
  # Update an existing project.
4826
- # API Path: /v2/projects/:id
5429
+ # API Path: /api/v2/projects/:id
4827
5430
  # == Parameters:
4828
5431
  # id::
4829
5432
  # id
@@ -4843,12 +5446,38 @@ end
4843
5446
  raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::ProjectParams")
4844
5447
  end
4845
5448
  end
4846
-
4847
- data_hash = params.to_h
4848
- err = params.validate
4849
- if err != nil
4850
- return nil, err
5449
+ if params.account_id != nil
5450
+ data_hash["account_id"] = params.account_id
5451
+ end
5452
+
5453
+ if params.main_format != nil
5454
+ data_hash["main_format"] = params.main_format
4851
5455
  end
5456
+
5457
+ if params.name != nil
5458
+ data_hash["name"] = params.name
5459
+ end
5460
+
5461
+ if params.project_image != nil
5462
+ post_body = []
5463
+ post_body << "--#{PhraseApp::MULTIPART_BOUNDARY}\r\n"
5464
+ post_body << "Content-Disposition: form-data; name=\"project_image\"; filename=\"#{File.basename(params.project_image )}\"\r\n"
5465
+ post_body << "Content-Type: text/plain\r\n"
5466
+ post_body << "\r\n"
5467
+ post_body << File.read(params.project_image)
5468
+ post_body << "\r\n"
5469
+ end
5470
+
5471
+ if params.remove_project_image != nil
5472
+ data_hash["remove_project_image"] = (params.remove_project_image == true)
5473
+ end
5474
+
5475
+ if params.shares_translation_memory != nil
5476
+ data_hash["shares_translation_memory"] = (params.shares_translation_memory == true)
5477
+ end
5478
+
5479
+
5480
+
4852
5481
  reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
4853
5482
  rc, err = PhraseApp.send_request(@credentials, "PATCH", path, reqHelper.ctype, reqHelper.body, 200)
4854
5483
  if err != nil
@@ -4859,7 +5488,7 @@ end
4859
5488
  end
4860
5489
 
4861
5490
  # List all projects the current user has access to.
4862
- # API Path: /v2/projects
5491
+ # API Path: /api/v2/projects
4863
5492
  # == Parameters:
4864
5493
  #
4865
5494
  # == Returns:
@@ -4880,7 +5509,7 @@ end
4880
5509
  end
4881
5510
 
4882
5511
  # Show details for current User.
4883
- # API Path: /v2/user
5512
+ # API Path: /api/v2/user
4884
5513
  # == Parameters:
4885
5514
  #
4886
5515
  # == Returns:
@@ -4901,7 +5530,7 @@ end
4901
5530
  end
4902
5531
 
4903
5532
  # Create a new style guide.
4904
- # API Path: /v2/projects/:project_id/styleguides
5533
+ # API Path: /api/v2/projects/:project_id/styleguides
4905
5534
  # == Parameters:
4906
5535
  # project_id::
4907
5536
  # project_id
@@ -4937,7 +5566,7 @@ end
4937
5566
  end
4938
5567
 
4939
5568
  # Delete an existing style guide.
4940
- # API Path: /v2/projects/:project_id/styleguides/:id
5569
+ # API Path: /api/v2/projects/:project_id/styleguides/:id
4941
5570
  # == Parameters:
4942
5571
  # project_id::
4943
5572
  # project_id
@@ -4961,7 +5590,7 @@ end
4961
5590
  end
4962
5591
 
4963
5592
  # Get details on a single style guide.
4964
- # API Path: /v2/projects/:project_id/styleguides/:id
5593
+ # API Path: /api/v2/projects/:project_id/styleguides/:id
4965
5594
  # == Parameters:
4966
5595
  # project_id::
4967
5596
  # project_id
@@ -4986,7 +5615,7 @@ end
4986
5615
  end
4987
5616
 
4988
5617
  # Update an existing style guide.
4989
- # API Path: /v2/projects/:project_id/styleguides/:id
5618
+ # API Path: /api/v2/projects/:project_id/styleguides/:id
4990
5619
  # == Parameters:
4991
5620
  # project_id::
4992
5621
  # project_id
@@ -5024,7 +5653,7 @@ end
5024
5653
  end
5025
5654
 
5026
5655
  # List all styleguides for the given project.
5027
- # API Path: /v2/projects/:project_id/styleguides
5656
+ # API Path: /api/v2/projects/:project_id/styleguides
5028
5657
  # == Parameters:
5029
5658
  # project_id::
5030
5659
  # project_id
@@ -5047,7 +5676,7 @@ end
5047
5676
  end
5048
5677
 
5049
5678
  # Create a new tag.
5050
- # API Path: /v2/projects/:project_id/tags
5679
+ # API Path: /api/v2/projects/:project_id/tags
5051
5680
  # == Parameters:
5052
5681
  # project_id::
5053
5682
  # project_id
@@ -5083,7 +5712,7 @@ end
5083
5712
  end
5084
5713
 
5085
5714
  # Delete an existing tag.
5086
- # API Path: /v2/projects/:project_id/tags/:name
5715
+ # API Path: /api/v2/projects/:project_id/tags/:name
5087
5716
  # == Parameters:
5088
5717
  # project_id::
5089
5718
  # project_id
@@ -5107,7 +5736,7 @@ end
5107
5736
  end
5108
5737
 
5109
5738
  # Get details and progress information on a single tag for a given project.
5110
- # API Path: /v2/projects/:project_id/tags/:name
5739
+ # API Path: /api/v2/projects/:project_id/tags/:name
5111
5740
  # == Parameters:
5112
5741
  # project_id::
5113
5742
  # project_id
@@ -5132,7 +5761,7 @@ end
5132
5761
  end
5133
5762
 
5134
5763
  # List all tags for the given project.
5135
- # API Path: /v2/projects/:project_id/tags
5764
+ # API Path: /api/v2/projects/:project_id/tags
5136
5765
  # == Parameters:
5137
5766
  # project_id::
5138
5767
  # project_id
@@ -5155,7 +5784,7 @@ end
5155
5784
  end
5156
5785
 
5157
5786
  # Create a translation.
5158
- # API Path: /v2/projects/:project_id/translations
5787
+ # API Path: /api/v2/projects/:project_id/translations
5159
5788
  # == Parameters:
5160
5789
  # project_id::
5161
5790
  # project_id
@@ -5191,7 +5820,7 @@ end
5191
5820
  end
5192
5821
 
5193
5822
  # Get details on a single translation.
5194
- # API Path: /v2/projects/:project_id/translations/:id
5823
+ # API Path: /api/v2/projects/:project_id/translations/:id
5195
5824
  # == Parameters:
5196
5825
  # project_id::
5197
5826
  # project_id
@@ -5216,7 +5845,7 @@ end
5216
5845
  end
5217
5846
 
5218
5847
  # Update an existing translation.
5219
- # API Path: /v2/projects/:project_id/translations/:id
5848
+ # API Path: /api/v2/projects/:project_id/translations/:id
5220
5849
  # == Parameters:
5221
5850
  # project_id::
5222
5851
  # project_id
@@ -5254,7 +5883,7 @@ end
5254
5883
  end
5255
5884
 
5256
5885
  # List translations for a specific key.
5257
- # API Path: /v2/projects/:project_id/keys/:key_id/translations
5886
+ # API Path: /api/v2/projects/:project_id/keys/:key_id/translations
5258
5887
  # == Parameters:
5259
5888
  # project_id::
5260
5889
  # project_id
@@ -5292,7 +5921,7 @@ end
5292
5921
  end
5293
5922
 
5294
5923
  # List translations for a specific locale. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
5295
- # API Path: /v2/projects/:project_id/locales/:locale_id/translations
5924
+ # API Path: /api/v2/projects/:project_id/locales/:locale_id/translations
5296
5925
  # == Parameters:
5297
5926
  # project_id::
5298
5927
  # project_id
@@ -5330,7 +5959,7 @@ end
5330
5959
  end
5331
5960
 
5332
5961
  # Exclude translations matching query from locale export.
5333
- # API Path: /v2/projects/:project_id/translations/exclude
5962
+ # API Path: /api/v2/projects/:project_id/translations/exclude
5334
5963
  # == Parameters:
5335
5964
  # project_id::
5336
5965
  # project_id
@@ -5366,7 +5995,7 @@ end
5366
5995
  end
5367
5996
 
5368
5997
  # Include translations matching query in locale export.
5369
- # API Path: /v2/projects/:project_id/translations/include
5998
+ # API Path: /api/v2/projects/:project_id/translations/include
5370
5999
  # == Parameters:
5371
6000
  # project_id::
5372
6001
  # project_id
@@ -5402,7 +6031,7 @@ end
5402
6031
  end
5403
6032
 
5404
6033
  # List translations for the given project. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
5405
- # API Path: /v2/projects/:project_id/translations
6034
+ # API Path: /api/v2/projects/:project_id/translations
5406
6035
  # == Parameters:
5407
6036
  # project_id::
5408
6037
  # project_id
@@ -5438,7 +6067,7 @@ end
5438
6067
  end
5439
6068
 
5440
6069
  # List translations for the given project if you exceed GET request limitations on translations list. If you want to download all translations for one locale we recommend to use the <code>locales#download</code> endpoint.
5441
- # API Path: /v2/projects/:project_id/translations/search
6070
+ # API Path: /api/v2/projects/:project_id/translations/search
5442
6071
  # == Parameters:
5443
6072
  # project_id::
5444
6073
  # project_id
@@ -5474,7 +6103,7 @@ end
5474
6103
  end
5475
6104
 
5476
6105
  # <div class='alert alert-info'>Only available in the <a href='https://phraseapp.com/pricing' target='_blank'>Control Package</a>.</div>Mark translations matching query as unverified.
5477
- # API Path: /v2/projects/:project_id/translations/unverify
6106
+ # API Path: /api/v2/projects/:project_id/translations/unverify
5478
6107
  # == Parameters:
5479
6108
  # project_id::
5480
6109
  # project_id
@@ -5510,7 +6139,7 @@ end
5510
6139
  end
5511
6140
 
5512
6141
  # <div class='alert alert-info'>Only available in the <a href='https://phraseapp.com/pricing' target='_blank'>Control Package</a>.</div>Verify translations matching query.
5513
- # API Path: /v2/projects/:project_id/translations/verify
6142
+ # API Path: /api/v2/projects/:project_id/translations/verify
5514
6143
  # == Parameters:
5515
6144
  # project_id::
5516
6145
  # project_id
@@ -5546,7 +6175,7 @@ end
5546
6175
  end
5547
6176
 
5548
6177
  # Upload a new language file. Creates necessary resources in your project.
5549
- # API Path: /v2/projects/:project_id/uploads
6178
+ # API Path: /api/v2/projects/:project_id/uploads
5550
6179
  # == Parameters:
5551
6180
  # project_id::
5552
6181
  # project_id
@@ -5566,6 +6195,14 @@ end
5566
6195
  raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::UploadParams")
5567
6196
  end
5568
6197
  end
6198
+ if params.autotranslate != nil
6199
+ data_hash["autotranslate"] = (params.autotranslate == true)
6200
+ end
6201
+
6202
+ if params.branch != nil
6203
+ data_hash["branch"] = params.branch
6204
+ end
6205
+
5569
6206
  if params.convert_emoji != nil
5570
6207
  data_hash["convert_emoji"] = (params.convert_emoji == true)
5571
6208
  end
@@ -5636,21 +6273,34 @@ end
5636
6273
  end
5637
6274
 
5638
6275
  # View details and summary for a single upload.
5639
- # API Path: /v2/projects/:project_id/uploads/:id
6276
+ # API Path: /api/v2/projects/:project_id/uploads/:id
5640
6277
  # == Parameters:
5641
6278
  # project_id::
5642
6279
  # project_id
5643
6280
  # id::
5644
6281
  # id
6282
+ # params::
6283
+ # Parameters of type PhraseApp::RequestParams::UploadShowParams
5645
6284
  #
5646
6285
  # == Returns:
5647
6286
  # PhraseApp::ResponseObjects::Upload
5648
6287
  # err
5649
- def upload_show(project_id, id)
6288
+ def upload_show(project_id, id, params)
5650
6289
  path = sprintf("/api/v2/projects/%s/uploads/%s", project_id, id)
5651
6290
  data_hash = {}
5652
6291
  post_body = nil
5653
6292
 
6293
+ if params.present?
6294
+ unless params.kind_of?(PhraseApp::RequestParams::UploadShowParams)
6295
+ raise PhraseApp::ParamsHelpers::ParamsError.new("Expects params to be kind_of PhraseApp::RequestParams::UploadShowParams")
6296
+ end
6297
+ end
6298
+
6299
+ data_hash = params.to_h
6300
+ err = params.validate
6301
+ if err != nil
6302
+ return nil, err
6303
+ end
5654
6304
  reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)
5655
6305
  rc, err = PhraseApp.send_request(@credentials, "GET", path, reqHelper.ctype, reqHelper.body, 200)
5656
6306
  if err != nil
@@ -5661,7 +6311,7 @@ end
5661
6311
  end
5662
6312
 
5663
6313
  # List all uploads for the given project.
5664
- # API Path: /v2/projects/:project_id/uploads
6314
+ # API Path: /api/v2/projects/:project_id/uploads
5665
6315
  # == Parameters:
5666
6316
  # project_id::
5667
6317
  # project_id
@@ -5684,7 +6334,7 @@ end
5684
6334
  end
5685
6335
 
5686
6336
  # Get details on a single version.
5687
- # API Path: /v2/projects/:project_id/translations/:translation_id/versions/:id
6337
+ # API Path: /api/v2/projects/:project_id/translations/:translation_id/versions/:id
5688
6338
  # == Parameters:
5689
6339
  # project_id::
5690
6340
  # project_id
@@ -5711,7 +6361,7 @@ end
5711
6361
  end
5712
6362
 
5713
6363
  # List all versions for the given translation.
5714
- # API Path: /v2/projects/:project_id/translations/:translation_id/versions
6364
+ # API Path: /api/v2/projects/:project_id/translations/:translation_id/versions
5715
6365
  # == Parameters:
5716
6366
  # project_id::
5717
6367
  # project_id
@@ -5736,7 +6386,7 @@ end
5736
6386
  end
5737
6387
 
5738
6388
  # Create a new webhook.
5739
- # API Path: /v2/projects/:project_id/webhooks
6389
+ # API Path: /api/v2/projects/:project_id/webhooks
5740
6390
  # == Parameters:
5741
6391
  # project_id::
5742
6392
  # project_id
@@ -5772,7 +6422,7 @@ end
5772
6422
  end
5773
6423
 
5774
6424
  # Delete an existing webhook.
5775
- # API Path: /v2/projects/:project_id/webhooks/:id
6425
+ # API Path: /api/v2/projects/:project_id/webhooks/:id
5776
6426
  # == Parameters:
5777
6427
  # project_id::
5778
6428
  # project_id
@@ -5796,7 +6446,7 @@ end
5796
6446
  end
5797
6447
 
5798
6448
  # Get details on a single webhook.
5799
- # API Path: /v2/projects/:project_id/webhooks/:id
6449
+ # API Path: /api/v2/projects/:project_id/webhooks/:id
5800
6450
  # == Parameters:
5801
6451
  # project_id::
5802
6452
  # project_id
@@ -5821,7 +6471,7 @@ end
5821
6471
  end
5822
6472
 
5823
6473
  # Perform a test request for a webhook.
5824
- # API Path: /v2/projects/:project_id/webhooks/:id/test
6474
+ # API Path: /api/v2/projects/:project_id/webhooks/:id/test
5825
6475
  # == Parameters:
5826
6476
  # project_id::
5827
6477
  # project_id
@@ -5845,7 +6495,7 @@ end
5845
6495
  end
5846
6496
 
5847
6497
  # Update an existing webhook.
5848
- # API Path: /v2/projects/:project_id/webhooks/:id
6498
+ # API Path: /api/v2/projects/:project_id/webhooks/:id
5849
6499
  # == Parameters:
5850
6500
  # project_id::
5851
6501
  # project_id
@@ -5883,7 +6533,7 @@ end
5883
6533
  end
5884
6534
 
5885
6535
  # List all webhooks for the given project.
5886
- # API Path: /v2/projects/:project_id/webhooks
6536
+ # API Path: /api/v2/projects/:project_id/webhooks
5887
6537
  # == Parameters:
5888
6538
  # project_id::
5889
6539
  # project_id