-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #626 from chradek/fix-optional-params-overloads
[v6] include optional parameters with no media type in mediatype-specific options bag
- Loading branch information
Showing
15 changed files
with
784 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020 Microsoft | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Azure MediaTypesV3Client SDK for JavaScript | ||
|
||
This package contains an isomorphic SDK for MediaTypesV3Client. | ||
|
||
### Currently supported environments | ||
|
||
- Node.js version 8.x.x or higher | ||
- Browser JavaScript | ||
|
||
### How to Install | ||
|
||
```bash | ||
npm install media-types-v3-client | ||
``` | ||
|
||
### How to use | ||
|
||
#### Sample code | ||
|
||
Refer the sample code in the [azure-sdk-for-js-samples](https://github.com/Azure/azure-sdk-for-js-samples) repository. | ||
|
||
## Related projects | ||
|
||
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) | ||
|
||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "media-types-v3-client", | ||
"author": "Microsoft Corporation", | ||
"description": "A generated SDK for MediaTypesV3Client.", | ||
"version": "1.0.0-preview1", | ||
"dependencies": { "@azure/core-http": "^1.0.4", "tslib": "^1.9.3" }, | ||
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"], | ||
"license": "MIT", | ||
"main": "./dist/media-types-v3-client.js", | ||
"module": "./esm/mediaTypesV3Client.js", | ||
"types": "./esm/mediaTypesV3Client.d.ts", | ||
"devDependencies": { | ||
"typescript": "^3.1.1", | ||
"rollup": "^0.66.2", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"uglify-js": "^3.4.9" | ||
}, | ||
"homepage": "https://github.com/Azure/azure-sdk-for-js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Azure/azure-sdk-for-js.git" | ||
}, | ||
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, | ||
"files": [ | ||
"dist/**/*.js", | ||
"dist/**/*.js.map", | ||
"dist/**/*.d.ts", | ||
"dist/**/*.d.ts.map", | ||
"esm/**/*.js", | ||
"esm/**/*.js.map", | ||
"esm/**/*.d.ts", | ||
"esm/**/*.d.ts.map", | ||
"src/**/*.ts", | ||
"README.md", | ||
"rollup.config.js", | ||
"tsconfig.json" | ||
], | ||
"scripts": { | ||
"build": "tsc && rollup -c rollup.config.js && npm run minify", | ||
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/media-types-v3-client.js.map'\" -o ./dist/media-types-v3-client.min.js ./dist/media-types-v3-client.js", | ||
"prepack": "npm install && npm run build" | ||
}, | ||
"sideEffects": false, | ||
"autoPublish": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ | ||
|
||
import rollup from "rollup"; | ||
import nodeResolve from "rollup-plugin-node-resolve"; | ||
import sourcemaps from "rollup-plugin-sourcemaps"; | ||
|
||
/** | ||
* @type {rollup.RollupFileOptions} | ||
*/ | ||
const config = { | ||
input: "./esm/mediaTypesV3Client.js", | ||
external: ["@azure/core-http", "@azure/core-arm"], | ||
output: { | ||
file: "./dist/media-types-v3-client.js", | ||
format: "umd", | ||
name: "MediaTypesV3Client", | ||
sourcemap: true, | ||
globals: { | ||
"@azure/core-http": "coreHttp", | ||
"@azure/core-arm": "coreArm" | ||
}, | ||
banner: `/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ ` | ||
}, | ||
plugins: [nodeResolve({ module: true }), sourcemaps()] | ||
}; | ||
|
||
export default config; |
37 changes: 37 additions & 0 deletions
37
test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ | ||
|
||
import * as operations from "./operations"; | ||
import * as Models from "./models"; | ||
import { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; | ||
|
||
class MediaTypesV3Client extends MediaTypesV3ClientContext { | ||
/** | ||
* Initializes a new instance of the MediaTypesV3Client class. | ||
* @param $host server parameter | ||
* @param options The parameter options | ||
*/ | ||
constructor( | ||
$host: string, | ||
options?: Models.MediaTypesV3ClientOptionalParams | ||
) { | ||
super($host, options); | ||
this.fooApi = new operations.FooApi(this); | ||
} | ||
|
||
fooApi: operations.FooApi; | ||
} | ||
|
||
// Operation Specifications | ||
|
||
export { | ||
MediaTypesV3Client, | ||
MediaTypesV3ClientContext, | ||
Models as MediaTypesV3Models | ||
}; | ||
export * from "./operations"; |
50 changes: 50 additions & 0 deletions
50
test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ | ||
|
||
import * as coreHttp from "@azure/core-http"; | ||
import * as Models from "./models"; | ||
|
||
const packageName = "media-types-v3-client"; | ||
const packageVersion = "1.0.0-preview1"; | ||
|
||
export class MediaTypesV3ClientContext extends coreHttp.ServiceClient { | ||
$host: string; | ||
|
||
/** | ||
* Initializes a new instance of the MediaTypesV3ClientContext class. | ||
* @param $host server parameter | ||
* @param options The parameter options | ||
*/ | ||
constructor( | ||
$host: string, | ||
options?: Models.MediaTypesV3ClientOptionalParams | ||
) { | ||
if ($host === undefined) { | ||
throw new Error("'$host' cannot be null"); | ||
} | ||
|
||
// Initializing default values for options | ||
if (!options) { | ||
options = {}; | ||
} | ||
|
||
if (!options.userAgent) { | ||
const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); | ||
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; | ||
} | ||
|
||
super(undefined, options); | ||
|
||
this.requestContentType = "application/json; charset=utf-8"; | ||
|
||
this.baseUri = options.endpoint || "{$host}"; | ||
|
||
// Parameter assignments | ||
this.$host = $host; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
test/integration/generated/mediaTypesV3/src/models/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
*/ | ||
|
||
import * as coreHttp from "@azure/core-http"; | ||
|
||
/** | ||
* Optional parameters. | ||
*/ | ||
export interface FooApiPostSendOnDefault$binaryOptionalParams | ||
extends coreHttp.OperationOptions { | ||
/** | ||
* Excluded Ids | ||
*/ | ||
excluded?: string[]; | ||
} | ||
|
||
/** | ||
* Optional parameters. | ||
*/ | ||
export interface FooApiPostSendOnDefault$textOptionalParams | ||
extends coreHttp.OperationOptions { | ||
/** | ||
* Excluded Ids | ||
*/ | ||
excluded?: string[]; | ||
} | ||
|
||
/** | ||
* Optional parameters. | ||
*/ | ||
export interface FooApiPostSend$binaryOptionalParams | ||
extends coreHttp.OperationOptions { | ||
/** | ||
* Excluded Ids | ||
*/ | ||
excluded?: string[]; | ||
} | ||
|
||
/** | ||
* Optional parameters. | ||
*/ | ||
export interface FooApiPostSend$textOptionalParams | ||
extends coreHttp.OperationOptions { | ||
/** | ||
* Excluded Ids | ||
*/ | ||
excluded?: string[]; | ||
} | ||
|
||
/** | ||
* Optional parameters. | ||
*/ | ||
export interface MediaTypesV3ClientOptionalParams | ||
extends coreHttp.ServiceClientOptions { | ||
/** | ||
* Overrides client endpoint. | ||
*/ | ||
endpoint?: string; | ||
} |
Oops, something went wrong.