Skip to content
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

[AutoPR apimanagement/resource-manager] [Hub Generated] Review request for Microsoft.ApiManagement to add version stable/2019-01-01 #2188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/apimanagement/arm-apimanagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 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
Expand Down
31 changes: 18 additions & 13 deletions sdk/apimanagement/arm-apimanagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ This package contains an isomorphic SDK for ApiManagementClient.

### How to Install

```
```bash
npm install @azure/arm-apimanagement
```

### How to use

#### nodejs - Authentication, client creation and listByService policy as an example written in TypeScript.
#### nodejs - Authentication, client creation and listByService api as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

```
```bash
npm install @azure/ms-rest-nodeauth
```

##### Sample code

```ts
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
Expand All @@ -36,8 +36,12 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new ApiManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const serviceName = "testserviceName";
const scope = "Tenant";
client.policy.listByService(resourceGroupName, serviceName, scope).then((result) => {
const filter = "testfilter";
const top = 1;
const skip = 1;
const tags = "testtags";
const expandApiVersionSet = true;
client.api.listByService(resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet).then((result) => {
console.log("The result is:");
console.log(result);
});
Expand All @@ -46,11 +50,11 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and listByService policy as an example written in JavaScript.
#### browser - Authentication, client creation and listByService api as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

```
```bash
npm install @azure/ms-rest-browserauth
```

Expand Down Expand Up @@ -82,8 +86,12 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
const client = new Azure.ArmApimanagement.ApiManagementClient(res.creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const serviceName = "testserviceName";
const scope = "Tenant";
client.policy.listByService(resourceGroupName, serviceName, scope).then((result) => {
const filter = "testfilter";
const top = 1;
const skip = 1;
const tags = "testtags";
const expandApiVersionSet = true;
client.api.listByService(resourceGroupName, serviceName, filter, top, skip, tags, expandApiVersionSet).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -100,6 +108,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
## 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/sdk/apimanagement/arm-apimanagement/README.png)
163 changes: 163 additions & 0 deletions sdk/apimanagement/arm-apimanagement/lib/apiManagementClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/*
* 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.
*/

import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as operations from "./operations";
import { ApiManagementClientContext } from "./apiManagementClientContext";


class ApiManagementClient extends ApiManagementClientContext {
// Operation groups
api: operations.Api;
apiRevision: operations.ApiRevision;
apiRelease: operations.ApiRelease;
apiOperation: operations.ApiOperation;
apiOperationPolicy: operations.ApiOperationPolicy;
tag: operations.Tag;
apiProduct: operations.ApiProduct;
apiPolicy: operations.ApiPolicy;
apiSchema: operations.ApiSchema;
apiDiagnostic: operations.ApiDiagnostic;
apiIssue: operations.ApiIssue;
apiIssueComment: operations.ApiIssueComment;
apiIssueAttachment: operations.ApiIssueAttachment;
apiTagDescription: operations.ApiTagDescription;
operation: operations.OperationOperations;
apiVersionSet: operations.ApiVersionSet;
authorizationServer: operations.AuthorizationServer;
backend: operations.Backend;
cache: operations.Cache;
certificate: operations.Certificate;
apiManagementOperations: operations.ApiManagementOperations;
apiManagementServiceSkus: operations.ApiManagementServiceSkus;
apiManagementService: operations.ApiManagementService;
diagnostic: operations.Diagnostic;
emailTemplate: operations.EmailTemplate;
group: operations.Group;
groupUser: operations.GroupUser;
identityProvider: operations.IdentityProvider;
issue: operations.Issue;
logger: operations.Logger;
networkStatus: operations.NetworkStatus;
notification: operations.Notification;
notificationRecipientUser: operations.NotificationRecipientUser;
notificationRecipientEmail: operations.NotificationRecipientEmail;
openIdConnectProvider: operations.OpenIdConnectProvider;
policy: operations.Policy;
policySnippet: operations.PolicySnippet;
signInSettings: operations.SignInSettings;
signUpSettings: operations.SignUpSettings;
delegationSettings: operations.DelegationSettings;
product: operations.Product;
productApi: operations.ProductApi;
productGroup: operations.ProductGroup;
productSubscriptions: operations.ProductSubscriptions;
productPolicy: operations.ProductPolicy;
property: operations.Property;
quotaByCounterKeys: operations.QuotaByCounterKeys;
quotaByPeriodKeys: operations.QuotaByPeriodKeys;
region: operations.Region;
reports: operations.Reports;
subscription: operations.Subscription;
tagResource: operations.TagResource;
tenantAccess: operations.TenantAccess;
tenantAccessGit: operations.TenantAccessGit;
tenantConfiguration: operations.TenantConfiguration;
user: operations.User;
userGroup: operations.UserGroup;
userSubscription: operations.UserSubscription;
userIdentities: operations.UserIdentities;
userConfirmationPassword: operations.UserConfirmationPassword;
apiExport: operations.ApiExport;

/**
* Initializes a new instance of the ApiManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
* subscription. The subscription ID forms part of the URI for every service call.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ApiManagementClientOptions) {
super(credentials, subscriptionId, options);
this.api = new operations.Api(this);
this.apiRevision = new operations.ApiRevision(this);
this.apiRelease = new operations.ApiRelease(this);
this.apiOperation = new operations.ApiOperation(this);
this.apiOperationPolicy = new operations.ApiOperationPolicy(this);
this.tag = new operations.Tag(this);
this.apiProduct = new operations.ApiProduct(this);
this.apiPolicy = new operations.ApiPolicy(this);
this.apiSchema = new operations.ApiSchema(this);
this.apiDiagnostic = new operations.ApiDiagnostic(this);
this.apiIssue = new operations.ApiIssue(this);
this.apiIssueComment = new operations.ApiIssueComment(this);
this.apiIssueAttachment = new operations.ApiIssueAttachment(this);
this.apiTagDescription = new operations.ApiTagDescription(this);
this.operation = new operations.OperationOperations(this);
this.apiVersionSet = new operations.ApiVersionSet(this);
this.authorizationServer = new operations.AuthorizationServer(this);
this.backend = new operations.Backend(this);
this.cache = new operations.Cache(this);
this.certificate = new operations.Certificate(this);
this.apiManagementOperations = new operations.ApiManagementOperations(this);
this.apiManagementServiceSkus = new operations.ApiManagementServiceSkus(this);
this.apiManagementService = new operations.ApiManagementService(this);
this.diagnostic = new operations.Diagnostic(this);
this.emailTemplate = new operations.EmailTemplate(this);
this.group = new operations.Group(this);
this.groupUser = new operations.GroupUser(this);
this.identityProvider = new operations.IdentityProvider(this);
this.issue = new operations.Issue(this);
this.logger = new operations.Logger(this);
this.networkStatus = new operations.NetworkStatus(this);
this.notification = new operations.Notification(this);
this.notificationRecipientUser = new operations.NotificationRecipientUser(this);
this.notificationRecipientEmail = new operations.NotificationRecipientEmail(this);
this.openIdConnectProvider = new operations.OpenIdConnectProvider(this);
this.policy = new operations.Policy(this);
this.policySnippet = new operations.PolicySnippet(this);
this.signInSettings = new operations.SignInSettings(this);
this.signUpSettings = new operations.SignUpSettings(this);
this.delegationSettings = new operations.DelegationSettings(this);
this.product = new operations.Product(this);
this.productApi = new operations.ProductApi(this);
this.productGroup = new operations.ProductGroup(this);
this.productSubscriptions = new operations.ProductSubscriptions(this);
this.productPolicy = new operations.ProductPolicy(this);
this.property = new operations.Property(this);
this.quotaByCounterKeys = new operations.QuotaByCounterKeys(this);
this.quotaByPeriodKeys = new operations.QuotaByPeriodKeys(this);
this.region = new operations.Region(this);
this.reports = new operations.Reports(this);
this.subscription = new operations.Subscription(this);
this.tagResource = new operations.TagResource(this);
this.tenantAccess = new operations.TenantAccess(this);
this.tenantAccessGit = new operations.TenantAccessGit(this);
this.tenantConfiguration = new operations.TenantConfiguration(this);
this.user = new operations.User(this);
this.userGroup = new operations.UserGroup(this);
this.userSubscription = new operations.UserSubscription(this);
this.userIdentities = new operations.UserIdentities(this);
this.userConfirmationPassword = new operations.UserConfirmationPassword(this);
this.apiExport = new operations.ApiExport(this);
}
}

// Operation Specifications

export {
ApiManagementClient,
ApiManagementClientContext,
Models as ApiManagementModels,
Mappers as ApiManagementMappers
};
export * from "./operations";
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.
*/

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "@azure/arm-apimanagement";
const packageVersion = "4.4.0";

export class ApiManagementClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
apiVersion?: string;
subscriptionId: string;

/**
* Initializes a new instance of the ApiManagementClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
* subscription. The subscription ID forms part of the URI for every service call.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ApiManagementClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (subscriptionId == undefined) {
throw new Error('\'subscriptionId\' cannot be null.');
}

if (!options) {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2019-01-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
}
Loading