-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic Sample generation in README #11
Merged
Merged
Conversation
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
Contributor
amarzavery
commented
Oct 21, 2017
- This is different than generating samples from x-ms-examples
- With this we will have autogenerated samples that show
- how to instantiate client
- a sample get method
🤖 AutoRest automatic publish job 🤖success (version: 2.0.56) |
This is how an autogenerated README.md would look like for an Azure Client. Microsoft Azure SDK for isomorphic javascript - StorageManagementClientThis project provides an isomorphic javascript package for accessing Azure. Right now it supports:
How to Install
<script type="text/javascript" src="https://raw.githubusercontent.com/Azure/azure-sdk-for-js/master/lib/services//storageManagementClientBundle.js"></script> How to usenodejs - Authentication, client creation and list operations as an example written in TypeScript.import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { StorageManagementClient, StorageManagementModels, StorageManagementMappers } from "azure-arm-storage-js";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new StorageManagementClient(creds, undefined, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error ocurred:');
console.dir(err, {depth: null, colors: true});
}); browser - Authentication, client creation and list operations as an example written in javascript.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Todos</title>
<script type="text/javascript" src="https://raw.githubusercontent.com/Azure/ms-rest-js/master/msRestBundle.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/Azure/ms-rest-js/master/msRestAzureBundle.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/Azure/azure-sdk-for-js/master/lib/services//storageManagementClientBundle.js"></script>
<script type="text/javascript">
document.write('hello world');
const subscriptionId = "<Subscription_Id>";
const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const client = new StorageManagementClient(creds, undefined, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error ocurred:');
console.dir(err, { depth: null, colors: true});
});
</script>
</head>
<body>
</body>
</html> Related projects |
joheredi
pushed a commit
that referenced
this pull request
Dec 12, 2019
Simplify AutoRest plugin registration and entrypoint
qiaozha
added a commit
that referenced
this pull request
Nov 4, 2023
* inital-commit-of-hierarchy-support * add model namespace name * reserve work * revert change in openai modular as of openai generic * generate operations * add classical operation hierarchy layers and reserve work * organize classic operation as hierarchy layered * change typespec to have simpler names * resolve operation conflicts with full namespace path * add namespace prefix for model only when conflicts * add edge case for model and operation name conflicts and resolve model conflicts if detect * enableModelNamespace as true for anomaly detector * fix hierarchy layer info bug * do not rename in Modular but rename in RLC if hierarchy client and conflict exists * fix model conflicts detect condition * update edge case generation * update package.json with hierarchy subpath * manual change for export the operation interface * reserve work * generate options in a centralized place * update generated code for edge case * loadtesting-with-hierarchy-false (#9) * loadtesting-with-hierarchy-false * do not return namespace hierarchies * use interface name when enable operation group in rlc * fix package.json * update generic generated files with just pure import order change (#10) * loadtesting-with-hierarchy-false * do not return namespace hierarchies * use interface name when enable operation group in rlc * fix package.json * update generic generated files just import order chaneg * disable-hierarchy-client-and-not-introduce-extra-changes (#11) * disable-hierarchy-client-and-not-introduce-extra-changes * fix model import issues * reserve work * reserve work * fix hierarchy layer overload * fix generation failure * fall back to enableOperationGroup logic if hierarchyClient is false * fix package.json and api layer export * fix smoke-test * fix lint error * tryfix ci * add operation group name back if hierarchy client is false * use operation group name if hierarchy client is false * rename operation if enableOperationGroup true and hierarchyClient false * do not include operation group name duplicated * only return interface name when enableOperationGroup true and hierarchyClient false * disable hierarchyClient for chatApi * Update packages/typespec-test/test/chatApi_modular/generated/typespec-ts/package.json * Update packages/typespec-test/test/loadtesting_modular/tspconfig.yaml * enableOperationGroup for service with operationGroup decorator * to not get namespace hierarchy if hierarchyClient is false (#12) * hierarchy-namespace-in-client-tsp * fix client structure with operations * update smoke-test * undo enable operation group for clients
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.