Skip to content

Commit 1f90a24

Browse files
author
Vlad Barosan
authored
Add Go SDK Generation for Cognitive Services data plane (#2178)
1 parent aab95ab commit 1f90a24

9 files changed

Lines changed: 205 additions & 27 deletions

File tree

specification/cognitiveservices/data-plane/CustomSearch/readme.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/CustomSearch.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.Search.CustomSearch
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch/Generated/CustomSearch
3030
sync-methods: none
@@ -57,11 +57,30 @@ python:
5757
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-customsearch
5858
```
5959

60+
## Go
61+
62+
These settings apply only when `--go` is specified on the command line.
63+
64+
``` yaml $(go)
65+
go:
66+
license-header: MICROSOFT_APACHE_NO_VERSION
67+
namespace: customsearch
68+
clear-output-folder: true
69+
```
70+
71+
### Tag: release_1_0 and go
72+
73+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
74+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
75+
76+
``` yaml $(tag) == 'release_1_0' && $(go)
77+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/customsearch
78+
```
6079

6180
## Suppressions
6281
Suppressing errors due to API design:
6382
``` yaml
6483
directive:
6584
- suppress: R3016
66-
reason: _type is a polymorphic discriminator that can't be changed.
85+
reason: _type is a polymorphic discriminator that can't be changed.
6786
```

specification/cognitiveservices/data-plane/EntitySearch/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/EntitySearch.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.Search.EntitySearch
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingEntitySearch/BingEntitySearch/Generated/EntitySearch
3030
```
@@ -54,4 +54,24 @@ python:
5454
python:
5555
basic-setup-py: true
5656
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-entitysearch
57+
```
58+
59+
## Go
60+
61+
These settings apply only when `--go` is specified on the command line.
62+
63+
``` yaml $(go)
64+
go:
65+
license-header: MICROSOFT_APACHE_NO_VERSION
66+
namespace: entitysearch
67+
clear-output-folder: true
68+
```
69+
70+
### Tag: release_1_0 and go
71+
72+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
73+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
74+
75+
``` yaml $(tag) == 'release_1_0' && $(go)
76+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/entitysearch
5777
```

specification/cognitiveservices/data-plane/Face/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/Face.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
sync-methods: None
2929
license-header: MICROSOFT_MIT_NO_VERSION
3030
azure-arm: false
@@ -59,3 +59,23 @@ python:
5959
basic-setup-py: true
6060
output-folder: $(python-sdks-folder)/azure-cognitiveservices-vision-face
6161
```
62+
63+
## Go
64+
65+
These settings apply only when `--go` is specified on the command line.
66+
67+
``` yaml $(go)
68+
go:
69+
license-header: MICROSOFT_APACHE_NO_VERSION
70+
namespace: face
71+
clear-output-folder: true
72+
```
73+
74+
### Tag: release_1_0 and go
75+
76+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
77+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
78+
79+
``` yaml $(tag) == 'release_1_0' && $(go)
80+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/face
81+
```

specification/cognitiveservices/data-plane/ImageSearch/readme.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/ImageSearch.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.Search.ImageSearch
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingImageSearch/BingImageSearch/Generated/ImageSearch
3030
sync-methods: none
@@ -57,6 +57,25 @@ python:
5757
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-imagesearch
5858
```
5959

60+
## Go
61+
62+
These settings apply only when `--go` is specified on the command line.
63+
64+
``` yaml $(go)
65+
go:
66+
license-header: MICROSOFT_APACHE_NO_VERSION
67+
namespace: imagesearch
68+
clear-output-folder: true
69+
```
70+
71+
### Tag: release_1_0 and go
72+
73+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
74+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
75+
76+
``` yaml $(tag) == 'release_1_0' && $(go)
77+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/imagesearch
78+
```
6079

6180
## Suppressions
6281
Suppressing errors due to API design:

specification/cognitiveservices/data-plane/NewsSearch/readme.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ These settings apply only when `--tag=release_1_0` is specified on the command l
2121
input-file: v1.0/NewsSearch.json
2222
```
2323

24-
## Suppressions
24+
## Suppressions
2525

26-
Suppressing errors due to API design:
27-
``` yaml
26+
Suppressing errors due to API design:
27+
``` yaml
2828
directive:
2929
- suppress: R3016
30-
reason: _type is a polymorphic discriminator that can't be changed.
30+
reason: _type is a polymorphic discriminator that can't be changed.
3131
```
3232

3333
## CSharp Settings
3434
These settings apply only when `--csharp` is specified on the command line.
35-
``` yaml $(csharp)
36-
csharp:
35+
``` yaml $(csharp)
36+
csharp:
3737
namespace: Microsoft.Azure.CognitiveServices.Search.NewsSearch
3838
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingNewsSearch/BingNewsSearch/Generated/NewsSearch
3939
sync-methods: none
@@ -64,4 +64,24 @@ python:
6464
python:
6565
basic-setup-py: true
6666
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-newssearch
67+
```
68+
69+
## Go
70+
71+
These settings apply only when `--go` is specified on the command line.
72+
73+
``` yaml $(go)
74+
go:
75+
license-header: MICROSOFT_APACHE_NO_VERSION
76+
namespace: newssearch
77+
clear-output-folder: true
78+
```
79+
80+
### Tag: release_1_0 and go
81+
82+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
83+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
84+
85+
``` yaml $(tag) == 'release_1_0' && $(go)
86+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/newssearch
6787
```

specification/cognitiveservices/data-plane/SpellCheck/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: V1.0/SpellCheck.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.SpellCheck
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Language/SpellCheck/BingSpellCheck/Generated/
3030
sync-methods: none
@@ -56,3 +56,23 @@ python:
5656
basic-setup-py: true
5757
output-folder: $(python-sdks-folder)/azure-cognitiveservices-language-spellcheck
5858
```
59+
60+
## Go
61+
62+
These settings apply only when `--go` is specified on the command line.
63+
64+
``` yaml $(go)
65+
go:
66+
license-header: MICROSOFT_APACHE_NO_VERSION
67+
namespace: spellcheck
68+
clear-output-folder: true
69+
```
70+
71+
### Tag: release_1_0 and go
72+
73+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
74+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
75+
76+
``` yaml $(tag) == 'release_1_0' && $(go)
77+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/spellcheck
78+
```

specification/cognitiveservices/data-plane/TextAnalytics/readme.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
The Cognitive Service Language SDK has support for the Text Analytics Cognitive Service.
44
While this repository contains the [Autorest](https://aka.ms/autorest) generated SDK, the easiest way to consume the SDK is by installing the Nuget package for it.
55

6-
Note that the Cognitive Services Language SDK is simply a wrapper on top of the Text Analytics Cognitive service. As such, it will generate calls to the Azure service.
6+
Note that the Cognitive Services Language SDK is simply a wrapper on top of the Text Analytics Cognitive service. As such, it will generate calls to the Azure service.
77

88

99
## Prerequisites
10-
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with **Text Analytics API**.
10+
You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with **Text Analytics API**.
1111

12-
You must also have the [endpoint and access key](../How-tos/text-analytics-how-to-access-key.md) that was generated for you during sign up.
12+
You must also have the [endpoint and access key](../How-tos/text-analytics-how-to-access-key.md) that was generated for you during sign up.
1313

1414
## Installing the Nuget SDK Package
1515
1. Create a new Console solution in Visual Studio.
@@ -42,7 +42,7 @@ namespace ConsoleApp1
4242

4343
// Extracting language
4444
Console.WriteLine("===== LANGUAGE EXTRACTION ======");
45-
45+
4646
LanguageBatchResult result = client.DetectLanguage(
4747
new BatchInput(
4848
new List<Input>()
@@ -129,8 +129,8 @@ log-file: logs/log.txt
129129

130130
## CSharp Settings
131131
These settings apply only when `--csharp` is specified on the command line.
132-
``` yaml $(csharp)
133-
csharp:
132+
``` yaml $(csharp)
133+
csharp:
134134
sync-methods: None
135135
license-header: MICROSOFT_MIT_NO_VERSION
136136
azure-arm: false
@@ -165,3 +165,23 @@ python:
165165
basic-setup-py: true
166166
output-folder: $(python-sdks-folder)/azure-cognitiveservices-language-textanalytics
167167
```
168+
169+
## Go
170+
171+
These settings apply only when `--go` is specified on the command line.
172+
173+
``` yaml $(go)
174+
go:
175+
license-header: MICROSOFT_APACHE_NO_VERSION
176+
namespace: textanalytics
177+
clear-output-folder: true
178+
```
179+
180+
### Tag: release_2_0 and go
181+
182+
These settings apply only when `--tag=release_2_0 --go` is specified on the command line.
183+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
184+
185+
``` yaml $(tag) == 'release_2_0' && $(go)
186+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v2.0/textanalytics
187+
```

specification/cognitiveservices/data-plane/VideoSearch/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/VideoSearch.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.Search.VideoSearch
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingVideoSearch/BingVideoSearch/Generated/VideoSearch
3030
sync-methods: none
@@ -55,4 +55,24 @@ python:
5555
python:
5656
basic-setup-py: true
5757
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-videosearch
58+
```
59+
60+
## Go
61+
62+
These settings apply only when `--go` is specified on the command line.
63+
64+
``` yaml $(go)
65+
go:
66+
license-header: MICROSOFT_APACHE_NO_VERSION
67+
namespace: videosearch
68+
clear-output-folder: true
69+
```
70+
71+
### Tag: release_1_0 and go
72+
73+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
74+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
75+
76+
``` yaml $(tag) == 'release_1_0' && $(go)
77+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/videosearch
5878
```

specification/cognitiveservices/data-plane/WebSearch/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ input-file: v1.0/WebSearch.json
2323

2424
## CSharp Settings
2525
These settings apply only when `--csharp` is specified on the command line.
26-
``` yaml $(csharp)
27-
csharp:
26+
``` yaml $(csharp)
27+
csharp:
2828
namespace: Microsoft.Azure.CognitiveServices.Search.WebSearch
2929
output-folder: $(csharp-sdks-folder)/CognitiveServices/dataPlane/Search/BingWebSearch/BingWebSearch/Generated/WebSearch
3030
sync-methods: none
@@ -55,4 +55,24 @@ python:
5555
python:
5656
basic-setup-py: true
5757
output-folder: $(python-sdks-folder)/azure-cognitiveservices-search-websearch
58+
```
59+
60+
## Go
61+
62+
These settings apply only when `--go` is specified on the command line.
63+
64+
``` yaml $(go)
65+
go:
66+
license-header: MICROSOFT_APACHE_NO_VERSION
67+
namespace: websearch
68+
clear-output-folder: true
69+
```
70+
71+
### Tag: release_1_0 and go
72+
73+
These settings apply only when `--tag=release_1_0 --go` is specified on the command line.
74+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
75+
76+
``` yaml $(tag) == 'release_1_0' && $(go)
77+
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/websearch
5878
```

0 commit comments

Comments
 (0)