Skip to content

Commit

Permalink
CodeGen from PR 15335 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 1810f0fb95865f0eb1e963015e8aa7f44c6ac0c4 into 552b277f9f8d2057a94dfc9c3e09c0d877c0ea30
  • Loading branch information
SDKAuto committed Jul 27, 2021
1 parent f5b1f58 commit 74fd2f9
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 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
8 changes: 3 additions & 5 deletions sdk/marketplaceordering/arm-marketplaceordering/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Azure MarketplaceOrderingAgreements SDK for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for MarketplaceOrderingAgreements.
This package contains an isomorphic SDK (runs both in node.js and in browsers) for MarketplaceOrderingAgreements.

### Currently supported environments

- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge, and Firefox.
- Latest versions of Safari, Chrome, Edge and Firefox.

### Prerequisites

Expand All @@ -21,7 +21,6 @@ Install both packages using the below command:
```bash
npm install --save @azure/arm-marketplaceordering @azure/identity
```

> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.

Expand All @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/

In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.

#### nodejs - Authentication, client creation, and get marketplaceAgreements as an example written in JavaScript.

##### Sample code
Expand Down Expand Up @@ -88,7 +86,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
const credential = new InteractiveBrowserCredential(
{
clientId: "<client id for your Azure AD app>",
tenantId: "<optional tenant for your organization>"
tenant: "<optional tenant for your organization>"
});
const client = new Azure.ArmMarketplaceordering.MarketplaceOrderingAgreements(creds, subscriptionId);
const publisherId = "testpublisherId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.6.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/marketplaceordering/arm-marketplaceordering",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/marketplaceordering/arm-marketplaceordering",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand All @@ -10,8 +9,8 @@

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import { TokenCredential } from "@azure/core-auth";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import { TokenCredential } from "@azure/core-auth";

const packageName = "@azure/arm-marketplaceordering";
const packageVersion = "2.1.0";
Expand Down Expand Up @@ -43,25 +42,25 @@ export class MarketplaceOrderingAgreementsContext extends msRestAzure.AzureServi
if (!options) {
options = {};
}
if(!options.userAgent) {
if (!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2015-06-01';
this.apiVersion = '2021-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) {
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand All @@ -11,6 +11,38 @@ import * as msRest from "@azure/ms-rest-js";

export { BaseResource, CloudError };

/**
* Metadata pertaining to creation and last modification of the resource.
*/
export interface SystemData {
/**
* The identity that created the resource.
*/
createdBy?: string;
/**
* The type of identity that created the resource. Possible values include: 'User',
* 'Application', 'ManagedIdentity', 'Key'
*/
createdByType?: CreatedByType;
/**
* The timestamp of resource creation (UTC).
*/
createdAt?: Date;
/**
* The identity that last modified the resource.
*/
lastModifiedBy?: string;
/**
* The type of identity that last modified the resource. Possible values include: 'User',
* 'Application', 'ManagedIdentity', 'Key'
*/
lastModifiedByType?: CreatedByType;
/**
* The timestamp of resource last modification (UTC)
*/
lastModifiedAt?: Date;
}

/**
* ARM resource.
*/
Expand Down Expand Up @@ -56,6 +88,10 @@ export interface AgreementTerms extends Resource {
* Link to the privacy policy of the publisher.
*/
privacyPolicyLink?: string;
/**
* Link to HTML with Azure Marketplace terms.
*/
marketplaceTermsLink?: string;
/**
* Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.
*/
Expand All @@ -68,6 +104,11 @@ export interface AgreementTerms extends Resource {
* If any version of the terms have been accepted, otherwise false.
*/
accepted?: boolean;
/**
* The system meta data relating to this resource.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly systemData?: SystemData;
}

/**
Expand Down Expand Up @@ -150,6 +191,14 @@ export interface OperationListResult extends Array<Operation> {
readonly nextLink?: string;
}

/**
* Defines values for CreatedByType.
* Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
* @readonly
* @enum {string}
*/
export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key';

/**
* Contains response data for the get operation.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand All @@ -12,6 +12,52 @@ import * as msRest from "@azure/ms-rest-js";
export const CloudError = CloudErrorMapper;
export const BaseResource = BaseResourceMapper;

export const SystemData: msRest.CompositeMapper = {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData",
modelProperties: {
createdBy: {
serializedName: "createdBy",
type: {
name: "String"
}
},
createdByType: {
serializedName: "createdByType",
type: {
name: "String"
}
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime"
}
},
lastModifiedBy: {
serializedName: "lastModifiedBy",
type: {
name: "String"
}
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String"
}
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime"
}
}
}
}
};

export const Resource: msRest.CompositeMapper = {
serializedName: "Resource",
type: {
Expand Down Expand Up @@ -80,6 +126,12 @@ export const AgreementTerms: msRest.CompositeMapper = {
name: "String"
}
},
marketplaceTermsLink: {
serializedName: "properties.marketplaceTermsLink",
type: {
name: "String"
}
},
retrieveDatetime: {
serializedName: "properties.retrieveDatetime",
type: {
Expand All @@ -97,6 +149,14 @@ export const AgreementTerms: msRest.CompositeMapper = {
type: {
name: "Boolean"
}
},
systemData: {
readOnly: true,
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand All @@ -9,8 +9,8 @@
export {
AgreementTerms,
BaseResource,
CloudError,
ErrorResponse,
ErrorResponseError,
Resource
Resource,
SystemData
} from "../models/mappers";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* 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
Expand Down Expand Up @@ -258,7 +257,7 @@ const getOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AgreementTerms
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down Expand Up @@ -370,7 +369,7 @@ const getAgreementOperationSpec: msRest.OperationSpec = {
bodyMapper: Mappers.AgreementTerms
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down Expand Up @@ -404,7 +403,7 @@ const listOperationSpec: msRest.OperationSpec = {
}
},
default: {
bodyMapper: Mappers.CloudError
bodyMapper: Mappers.ErrorResponse
}
},
serializer
Expand Down
Loading

0 comments on commit 74fd2f9

Please sign in to comment.