From 28c628a37361980225402087812abc48276514ff Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Apr 2022 01:17:06 +0000 Subject: [PATCH] CodeGen from PR 17856 in Azure/azure-rest-api-specs Dev cost management microsoft.cost management 2022 02 01 preview (#17856) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add new Azure Object Anchors API version 0.3-preview.0 (#17117) * add 0.3-preview.0 * fix INVALID_FORMAT * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2021-08-08 (#17162) * Adds base for updating Microsoft.AlertsManagement from version preview/2021-08-08-preview to version 2021-08-08 * Updates readme * Updates API version in new specs and examples * 1. added input files to new tag 2. changed alerts management client tag to the new tag Co-authored-by: Liran Englender * Add batch tag for streamanalytics readme.go.md (#17191) * Add batch tag for streamanalytics readme.go.md * fix * S360 - fixing pending 3 Swagger KPIs (#17195) * Update ResourceHealth.json fixing Swagger changes * Update ResourceHealth.json fixing PR checks * Create Operations_List.json add new file * Add AML skill to preview swagger for Search Service (#16910) * add aml skill to preview swagger for search service' * update * Fixing S360 issues (#17014) * Fixing S360 issues * Fix style * Add specs for ACS Chat preview7 (#16887) * Baseline using previous API version * Updates for preview7 * Update readme.md * Prettier fix * Fix readme * Fix example for update-participant Co-authored-by: Po Tsang * Add servicePrincipalCredentialType and servicePrincipalCredential into AzureBlobFSLinkedService (#17036) * Add servicePrincipalCredentialType and servicePrincipalCredential into AzureBlobFSLinkedService * update * revert some change * Device update public preview refresh (#17205) * Batch2: approved PR 4891 https://github.com/Azure/azure-rest-api-specs-pr/pull/4891 * Batch3: minor updates (PR 5556) https://github.com/Azure/azure-rest-api-specs-pr/pull/5556 Co-authored-by: Laurent Mazuel * Azure Synapse Workspace PublicNetworkAccess Fix (#17210) Co-authored-by: Nikhil Kumar * 2021-08-01-only (#17224) * [NetApp Files] Bug Fix volumeGroups tag, backup properties creationDate and examples (#17157) * Fix volumeGroups tag, bakcup properties creationDate and examples * Fix Staging model validations * Example ref * Microsoft.OperationalInsights: 2021-12-01-preview (#17138) * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * code review changes. * Update Tables.json * Update Tables.json * OperationalManagement: 2021-12-01-preview * more fixes. * Update Clusters.json * Tables: Sentinel+CLV2 changes. * Tables: More descriptions. * removing un related child resources. * Create OperationsListByTenant.json * Update Tables.json * Update TablesGet.json * Add systemData example. * Model fixes + pretty * adding description to ip data hint. * Update Tables.json Co-authored-by: Dudi Likvornik * [DO NOT MERGE ] Introduce new scanners resource type (#17107) * introduce new scanners resource type * fix error * fixing errors * fixing errors * fix error * fixing errors * fixing comments * adding new tag * Azure Batch 2022-01-01.15.0 Data Plane Update (#16960) * Initial commit for comparison * Update BatchService Swagger file PR Feedback * Update examples Ran prettier * Updated readme Fixed tag * Language API for TA (2021-11-01-preview) (#16256) * WIP for language api spec for TA * Updated preview version number; finished up async definitions * Finished first draft of full spec * Finished first draft of full spec, minus FHIR structuring in HC output * Removed features not included in 2021-11-01 preview * Update custom text tasks TODOs * Moved common definitions to TA-specific definitions * Added custom text tasks to JobManifest * Addressing feedback from PR comments and internal review * Addressed some PR comments * Updated some remaining references to documents * PR comments * Updated a previous change * Reverted references to 'records' back to 'documents' * A few small updates to examples; removed base Task type to simplify structure * PR comments * Addressed TODO items; removed LD-related objects (will be added in another preview) * Fixed anonymous types * Removed required field for body in POST request * Fix prettier check * Added a few more details; experimental change for documents property * Ran prettier * Correction to AnalysisInput object * PR comments * Added custom entities task to examples * PR comments * Prettier check * Troubleshooting model validation failure Co-authored-by: Abigail Hartman Co-authored-by: Kareem Yousef Co-authored-by: Abby Hartman * Fix flipped order in Face generated models (#16846) * Fix flipped order in Face generated models The recent change changing a nested parameter from optional to required caused the AutoRest generated model to have a reversed order of two string arguments. Expanding the nesting for affected models to avoid breaking changes. * Fix malformatted examples * Update Resources.json (#16996) * Update Resources.json * Specify additionalProperties type * CDS component type update - mismatch between swagger and code values (#17183) * [Hub Generated] Review request for Microsoft.CostManagement to add version preview/2020-12-01-preview (#13609) * Latest * Latest * Latest * Latest * Latest * Latest * Latest * Latest * Latest * Latest * Latest * FixS360 | Microsoft.Billing (#13771) * fixing billing accounts and operations * adding total count. * typo fix * fixing spell check and prettier * Vakuncha changingcsharpreadme (#13806) * Update readme.csharp.md * Update readme.csharp.md * [aks] fix vm size model and osDiskType description (#13763) * fix: agent pool vm size should be string, not enum * fix: osDiskType default description for >= 2020-11-01 * [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-03-01-preview (#13267) * init * fix format * sync * read only * fix sample * fix Co-authored-by: Teng Pan * storagesync readme t2 config (#13810) * storagesync readme t2 config * storagesync readme.python t2 config * Updated SAS swagger with latest changes. (#13439) * Fixed hostname in the Offazure swaggers. * added newest swagger from service repo. This contains PE changes too. * rewritten swagger changes on existing swagger * some fixes to swagger * added examples. * fixes * edit * edit. * fixes * minor fix * edit * edit * edited default api version tag * Dev weather microsoft.maps 1.0 (#13796) * Remove preview from Weather API, remove X-Publish, and convert X-ms-enum ModelAsString to true * Revert changes to package-lock.json * Fix spelling error * Adding Azure Object Anchors error codes for IngestionProperties (#13787) * Added Azure Object Anchors error code field to IngestionProperties * Fixed spacing in example * Moved changes to new version * Addressed version mismatch, spacing * Fixed versions on examples * Readonly error code * Seeing if readonly error code is breaking * Revert "Seeing if readonly error code is breaking" This reverts commit c0b16f07c4a46a07fc7831a1735bb290804242ea. * Model error code as string * Renamed examples to asset conversion nomenclature * Fixed rename issues * Fixed issue #9593 (#13262) * Fixed issue #9593 * Removed redundant PrivateEndpointConnectionProperties attribute * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-05-01 (#13800) * Fixed Swagger Validation Errors * Fixed Model Validation * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 (#13788) * Fixed Swagger Validation Errors * Fixed Type * Fixed Type * Fixed Setting Properties * Fixed Punctuation * Removed Item * Added Items Properties * Fixed Required Property * azurestack wave4 t2 config (#13813) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. (#13490) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. * Add system metadata to tracked resources in "Microsoft.AppConfiguration". Updated ConfigurationStore to reference the common tracked resource type definition. * Added disableLocalAuth property. * Add new api version swagger to readme. * Added/updated examples and added suppressions for standardized APIs. * Fixed prettier. * Add missing property fileStorageSkuName into MySQL Flexible Server spec (#13693) * appplatform t2 readme config (#13829) * customproviders t2 readme config (#13831) * Update readme.csharp.md (#13807) * [Sentine][Data connectors][Fix correctness bug] (#13175) * update required fields * update required fields * Explicitly define KeyCreationTime in Feb21 (#13757) * Explicitly define KeyCreationTime Explicitly define KeyCreationTime * Fix KeyCreationTime Example Fix KeyCreationTime Example * Add Microsoft.M365SecurityAndCompliance RP (#13646) * Add Microsoft.M365SecurityAndCompliance RP * fix datetime and common-types file path * update common-types file path * add preview path in readmego * replace stable with preview * remove duplicate tags * refer MIPPolicySync json in readme * service name for java (#13837) * Dev keyvault microsoft.key vault 2021 04 01 preview (#13585) * Adds base for updating Microsoft.KeyVault from version preview/2020-04-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Open API change for Managed Hsm private endpoints feature (#12938) * Open API change for Managed Hsm private endpoints feature * Fixing spell check errors * Fixing spell check errors * Prettier fixes * Fixing swagger validation errors * Fixing systemData property reference * Adding publicNetworkAccess property based on private endpoint requirement. * GET responses following a successful DELETE should be returning 404. … (#13054) * GET responses following a successful DELETE should be returning 404. Only the DELETE response is to return 204 if the resource didn't exist (it allows idempotent deletes). (cherry picked from commit b752a19c6cc1f8a8eed9f106e2c77b8d5b5db19f) * Removing 404 as it is taken care by default response. * Added new routes for Deleted ManagedHsm for Soft Delete Feature (#13282) * Added new routes for Deleted ManagedHsm and examples, updated ManagedHsm definition to include PurgeDateTimeUTC * Fixing validation issues. * Fixing errors in properties in example jsons * Delete keyvault.json Deleted an errant json file * Fixed misspelling of property in examples * Fixed x-ms-examples naming, fixed camelcasing * Addressing comments in PR to make 204s 404s and also changing PurgeDateTimeUTC to scheduledPurgeDate * Added schema definitions for 404 * Removed 200 for purge Co-authored-by: Soohwan Kim * Addressing Comments for PR 13585 (#13586) * Removed 404s to allow requests to fall through to default * Removing 404s from examples Co-authored-by: Soohwan Kim * Added deletedmanagedhsm object to examples and managedhsm.json (#13591) * Added deletedmanagedhsm object to examples and managedhsm.json * Fixing error in references to correct values * Changed vaultId to mhsmId in exmaples Co-authored-by: Soohwan Kim * Try to use the common type for SystemData (#13723) * Add SystemData property for KeyVault * 04012021 fix schema (#13749) * Resolving conflict with custom-words.txt * Add 2021 preview to azureresourcechema, add suppression to readme * Add 2021 preview to azureresourcechema * Merging custom-words.txt Co-authored-by: Soohwan Kim * Add missing default error response (#13762) * Fix Lint error (#13765) * Add missing default error response * Update the integer format to fix Lint error * Add securityDefinitions * Added python tag for 2021 preview (#13805) Co-authored-by: Soohwan Kim * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (#13822) * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (cherry picked from commit c1c5aebfb98cacd0a4ee5596fb7b0d9f782a9a3e) * prettier fix * Add suppression for SystemData (#13835) * Add suppression for SystemData * Fix linting error R4036 - ImplementPrivateEndpointAPIs * specify the suppression for SystemData * Revert "specify the suppression for SystemData" This reverts commit cbebab81ab08ec1a29b41c891c58cf08ff2eb3c4. Co-authored-by: jiacheng-L <71623842+jiacheng-L@users.noreply.github.com> Co-authored-by: kim-soohwan <40476315+kim-soohwan@users.noreply.github.com> Co-authored-by: Soohwan Kim Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> * hybridnetwork only track2 configure (#13832) * hybridnetwork only track2 configure * remodify * namespace del Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * terraform readme for alertsmanagement (#13744) Co-authored-by: Your Name * add tags back in the adp readme (#13850) * Add device principal type (#13799) * copy files from previous version * add device principal type, update versions * fix * system data requirement * Added CheckNameAvailability, Identity, systemData, used ErrorResponse v2 in DeviceUpdate (#13750) * Update deviceupdate.json * Update deviceupdate.json * Add files via upload * Update deviceupdate.json * Update deviceupdate.json * Update Accounts_Update.json * Update Accounts_Create.json * Update Instances_Create.json * Update deviceupdate.json * Linux line ending * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update deviceupdate.json * Update deviceupdate.json * fixed typo in the example files (#13764) * Update CODEOWNERS (#13795) Updating list of Azure Cognitive Search team members * Update GenerateDetailedCostReportBySubscriptionAndTimePeriod.json (#13772) Update example data * [Hub Generated] Public private branch 'stuartko/Mar21_NewTSVersion' (#13811) * Adding version 2021-03-01-preview (copy of previous version) * Adding new metadata property * Adding uiDefinition property. * Update uiDefinition name to uiFormDefinition (per a change by the service feature author). No change to functionality. * Template Specs: Renaming template to "mainTemplate" and changing "artifacts" to be more specific "linkedTemplates". * Swagger changes for 2021-02-01-preview api version (#13794) * Copy existing preview version * Changes to databoxedge json file * Update readme files * Correct Spell Check * Fix Readme.go error * Update examples * Update all schemas.md files (#13862) * typo: implmentation -> implementation (#13644) * Add MongoDB/MongoDBAtlas sink (#13669) * Add MongoDB/MongoDBAtlas sink, add disableMetricsCollection in read/wirte properties * Revert disableMetricsCollection related changes * Azure ML new API version 20210401 (#12981) * Add Identity to createWorkpace example * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * revert change on transitivePE and notebookKeys * revert change on transitivePE and notebookKeys * add new stable version 2021-01-01 * add ListNotebookAccessToken * add primaryUserAssignedIdentity * fix missing properties and apis * fix one more missing property * 202 status for start and stop CI * make resync keys long runnin operation in version Jan2021 * resync keys 204 * update resync keys example * Dont throw 204 for resync * update resync keys * Formatting * revert Jan2021changes and add new version * start apr2021 version for azure ml rp * undo remove new line in jan2021 * use systemData definition in common * removed old files * fix small swagger bugs * run prettier * remove reference to sku * update readme * minimum agentCount should be 0 * add createdOn and ModifiedOn to compute properties * add LoadBalancerType to aks compute * add isNotebookInstanceCompute to virtualMachine * add leafDomainLabel to SslConfiguration * add overwriteExistingDomain to SslConfiguration * add synapseSpark as supported compute-type * update patch compute response to 202 * remove location from example responses * Revert "remove location from example responses" This reverts commit 048bf2551513afae842a9c4fbb5861aeddc6c33a. * MachineLearningCompute_Update should have a 200 response * sys data to use local def due to naming conflicts. * Fix enum casing * Fix operationId PR comment. * Change opId in apr version * remove 20210401 for easy review * only change api version * merge changes for 20210401 version * Add x-ms-discriminator-value for Synapse spark * camelcase loadbalancer properties * add createdOn and Modified on to examples * address AvoidAnonymousTypes error for SynapseSpark * Minor fixes + new property * Remove subscription state. Co-authored-by: zhaomuzhi Co-authored-by: Vinay Rajmal Soni Co-authored-by: jopet@microsoft.com Co-authored-by: Josh Peterson <15050193+joshanator@users.noreply.github.com> * datashare readme t2 config (#13833) * add readme terraform (#13717) * adding a new API version for Restore API and adding targetVirtualMachineId field for AzureWorkloadRestoreRequest (#13638) * copying previous change * Adding targetVirtualMachineId field for Azure Workload Restore requests * updating crr version and examples * removing new api-version * adding back the new api-version * removing Snapshot related fields * updating readme.md * corrected the path Co-authored-by: Chandrika Gonuguntla * chore: resort custom-words.txt from bad merge (#13868) * [ApplicationInsights] Fix failure for python SDK (#13875) * [Hub Generated] Review request for Microsoft.Insights to add version preview/2020-10-05-preview (#13712) * Adjustments to API to include validation grouping and updated text. * Fixed missing curly brace * adjusted name * Added basic and standard examples * adjusted type. * corrected case for key value * [Hub Generated] Review request for Microsoft.Insights to add version preview/2021-03-03-preview (#13269) * Adds base for updating Microsoft.Insights from version preview/2020-10-05-preview to version 2021-03-03-preview * Updates readme * Updates API version in new specs and examples * Add DiagnosticServiceToken API * Update examples to split tokens for readonly vs readwrite * Fix accoding to code review feedback * Update examples due to review feedback from ARM * add configuration for vmware (#13879) Co-authored-by: Your Name * keyvault t2 config (#13863) * keyvault t2 config * keyvault multi-api config * multi api config * config reset * add package version * hanaonazure t2 readme config (#13880) * Remove x-ms-azure-resource (#13500) Co-authored-by: Dongwei Wang * Juniwang/sr202010401preview (#13664) * prepare to add new api-version: copy everything from 2020-07-01-preview * Adding new api-version * Fix required body and annotate ms secrets * remove secrets example from swagger * fix prettier * add datashare terraform configuration (#13876) Co-authored-by: Your Name * storage readme t2 config (#13881) * storage readme t2 config * storage t2 config * healthcareapis t2 config (#13884) * typo: APIkeys -> APIKeys (#13641) * Allow release_policy to be nullable (#13826) * Fix type of Anserws and Captions (#13872) * change the value of license header (#13886) * [Synapse] - library_append API adds comp parameter (#13841) * [Synapse] - add comp parameter * Update example files Co-authored-by: Dongwei Wang * Remove 200 response from async operation (#13190) * Async operation always returns 202 on initial call * Address review feedback * Revert "Address review feedback" This reverts commit 9ae550b95c1082c8383595a943a9abe5990fd4ef. * add minimal tls version for mariadb (#11779) * [Synapse] - add Swagger code owner (#13882) Co-authored-by: Dongwei Wang * add con figuration for databoxedge (#13877) Co-authored-by: Your Name * add configuration for resourcemover (#13878) Co-authored-by: Your Name * Reduce code owner scope for Monitor.Exporters team (#13898) * [portal]Update readme.python.md (#13907) * Update readme.python.md * Update readme.md * Update readme.python.md * Update readme.python.md * Dev dfp microsoft.dfp 2021 02 01 privatepreview (#13305) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * DFP API specs. Copied from Azure-PPE * Spelling fix. instnace => instance * Fix resource provider name to pascal case * Added '/providers/Microsoft.Dfp/operations' * Added SystemData (fix R4009 error) * Fix validation errors * Prettier fixes * Removed non-existend parameter sku * Style fixes in DFP API specs * Swagger ModelValidation failures fix * Fix operations API * Fix operations API validation failure * 1. Added example for lists operations. 2. made the API preview instead of privatepreview * Fix path in readme's * Fix in readme * Added readonly attribute to systemdata * Added readonly attribute to systemdata * Fix in python SDK readme * Fixes in ListOperations.json examples * Fixed API version * Added type to response bodies * Fix typos in examples (urls) * Added 201 response into createInstance example * Renamed RP name from Microsoft.Dfp to Microsoft.Dynamics365Fraudprotection * Added long-running result for creation instance * Added nextlink * Fix in checkNameAvailability definition URL * Next link parameter * Using references to common types instead of re-declaring them * Reused common type. Fixed provisioning state * Nesting error fix * Fixed examples * Fix * Fix in error response definition * Rename RP. Fix examples in readme's * Added http 202 * Added http 202 to examples * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-10-01 (#13818) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-09-01 to version 2020-10-01 * Updates readme * Updates API version in new specs and examples * Adding new fields for 2020-10-01 * Updating wording for disablePasswordAuthentication' Co-authored-by: jmccarthy * Remove name check from client side (#13492) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * Update deviceupdate.json (#13900) * [Hub Generated] Review request for Microsoft.ResourceHealth to add version stable/2018-07-01 (#13817) * Updated api-version * Removed systemData * Updated api-version * Updated the example * Add EligibleChildResources resource for PIM + update examples (#13803) * PIM API Specs * update readme * Update * Update readme * operation id fix * name fix * Name changes * fix * Fix * Changes based on docs generated * Scope fix in example * Updates for documentation * Change operation name * Update examples * Add expanded properties * Fix formatting * Fixes * Fix * fixes * Update the policy specs * Fix the policy objects and pell checks * fix the checks * fix the property * fix syntax * Prettier * Update Examples * Update Enums * ADd eligible child resource API specs * prettier fix * Update read me files * update * update * fix * update * Update Enums * update * update * update * update example Co-authored-by: Aman Swaika Co-authored-by: Gaurav Mishra (IDENTITY) * refine readme.go.md (#13906) Co-authored-by: Your Name * [Service Fabric Managed Clusters] adding api version 2020-05-01 (#13860) * initial commit 2021-05-01 to compare with previous version 2021-01-01-preview * update models * update examples * fix isStateless description * add 2021-05-01 version to readme * add x-ms-enum to diskType and add missing managedClsuterVersions paths fix example names add managed cluster version paths add default error * fix clusterversion by version and ClusterState descriptions Co-authored-by: Alfredo Santamaria Gomez * Task 9639284: Swagger changes for new UK agreement templates (#13895) * Task 9639284: Swagger changes for new UK agreement templates * Renamed as per comments. Co-authored-by: Umang Shah * Confluent new preview version + S360 fix (#13809) * Adding new API version for Microsoft.Confluent * Prettier fix * updated status property in OfferDetail updated status property in OfferDetail to fix swagger correctness issue * fix swagger live validation updated operations response to fix swagger live validation Co-authored-by: Srinivas * [Hub Generated] Public private branch 'juniwang/wps' (#13905) * Onboarding Azure WebPubSub service * reference ErrorResponse from common types and adding network ACL * disable cors, enable feature flags and fix several policy violations * remove anonymousConnectPolicy since it's not ready for now * add property publicNetworkAccess per NRP requirement * revert package-lock.json * reset package-lock.json * dns t2 readme config (#13923) * update readme (#13918) * add current readmes for generating python form recognizer (#12013) * add current readmes for python form recognizer * fix release tag * updates for multiapi and preview.3 * fix so that gen code outputs in generated folder * remove tag since swagger not in yet * unbreak build * just target preview 3 * don't run track 1 gen with python * Set x-ms-api-version to false for vaults list (#13924) * Set x-ms-api-version to false for vaults list (#13925) * Update event description to include the event name (#13867) * Update event description to include the event name * Update readme to include guidelines for defining a new event * Fix description * Renamed enum values for SDK auto generation (#13938) * Renamed enum values for SDK auto generation * Tabs to spaces * Newline added * [Document Translator] update operation names (#13915) * update operation names * make body required * Update ErrorName * Apply changes to stable * Fix samples * fix sample * Fix glossary sample * Address comments and update definitions names * Revert "Task 9639284: Swagger changes for new UK agreement templates (#13895)" (#13946) This reverts commit ea5bc27ee9cadeb67767d774c82095be2420bcad. * Adding new preview API for promotions (#11599) * Adding new preview API for promotions * Avacado fix * Fixing JSON * fixing the promo param * fixning linting issues * Fixing JSON * fixing JSON * fixing linting issues * Adding delete 204a * Adding delete 204 * Adding validation fixes * fixing spellings * Linting issues * running prettier * ARM review feedback * Fixing linting issues * Fixing prettier * Fixing version * Fixing SDK * fixing go sdk * revert go.md Co-authored-by: Rishi Kapoor * Exposing undocumented Databricks workspace properties for fixing S360 issues (#13683) * exposing storage account name, sku * Prettier fixes * Fixing the review comment * Adding No Public IP related properties * Updating the remaining properties related to S360 * Fixing review comments * Fixing Spell Check issue * hybridcompute readme t2 config (#13910) * readme t2 config * hybridcompute t2 readme config * web readme t2 config (#13909) * web readme t2 config * web readme.python t2 config * Add x-ms-api-version (#13834) * Update CheckNameAvailability_Available.json (#13914) * webpubsub t2 config (#13949) * Update StaticSite.json (#13768) * Update StaticSite.json Add private endpoint connections to static site object. * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * increment readme version * address PR comments * add examples * fix examples * Add data-plane samples creation template (#13528) * Add data-plane samples * Simplified template * webpubsub readme t1 del (#13953) * Add $(multiapi) to QnA Maker's readme.md (#13819) Generators were processing every tag when only a single one was desired. This is the common solution to support multi-api SDKs. * IoT data-plane for drwill-ms (#13964) * add missing usage.json to v5 sdk tag (#13960) * [Hub Generated] Review request for Microsoft.Kusto to add version stable/2021-01-01 (#13306) * Add new api version 2021 * remove managedIdentity since we won't support it in this version * CR comments * Add default value for contine on errros * Fix swagger correctness issues * Fix typo * resource t2 readme config (#13974) * Added new API and API version for private DNS zone suffix (#13789) * Added new API and API version for private DNS zone suffix * trigger validation pipelines * Add new API to readme * Fix ARM pipelines * Try fix again * Fix again * Add Operations API * Revert "Add Operations API" This reverts commit 9d4ca9e557763feb3a6089ff9d4c958b3843730e. * Revert "Revert "Add Operations API"" This reverts commit 7cf197c1d453764f0396713a2ab172a20e35b1c4. * Revert "Revert "Revert "Add Operations API""" This reverts commit 05744390e440984da8134b64a979a6e61fb9b7ae. * Revert "Revert "Revert "Revert "Add Operations API"""" This reverts commit 61b76b1623d9e5796bb8187edf0fc46351e78231. * Revert "Revert "Revert "Revert "Revert "Add Operations API""""" This reverts commit 9f55eb4c399eb48a8578906f6bea43b10c91b8be. * Address review comment from ARM * Revert "Address review comment from ARM" This reverts commit cb6d1b01860de72eec80856f64b602c72a1f26a7. * Revert "Revert "Address review comment from ARM"" This reverts commit 227cf73797ee24a674d76e3ccd2990b84bc8d11a. * Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API"""""" This reverts commit 34ae6c70a514e0290ffb41f7ddb5bbbd5c6cbee3. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API""""""" This reverts commit a11c889a65b0fa4257b03a247d75fbea769f4e2c. * Add previous APIs to tag * Retrigger build * fix service name for Java (#13979) * Add optional param - private DNS zone to server API (#13716) * Add optional param - private DNS zone to server API * Follow comment to resolve go sdk issue. * [Hub Generated] Review request for Microsoft.Synapse to add version preview/2021-04-01-preview (#13874) * Adds base for updating Microsoft.Synapse from version stable/2021-03-01 to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * add changed files for kustoPool * Ravi changes to fix LinDiff validation * Add Itay Sofer's changes * filizt comments mid-way * Remove clouderror and resplace with "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" * Add IotHubDataConnection and EventGridDataConnection * Modify PUT to OK, CREATED, ACCEPTED * Change from provisioningState to ResourceProvisioningState * Add BlobStorageEventType * Remove 202 when creating a KustoPool * Change PUT/PATCH 202 responses * Remove 202 in PATCH/PUT operations where having both 200 & 201 * Add "isIdentityCertExprired" to custom-words.txt * Remove isIdentityCertExprired from custom-words.txt * Add Exprired to cSpell.json Co-authored-by: Amit Elran * Removing x-ms-flatten property (#13929) * manual changes for swagger * changes for long-running operations * changes for validate for backup and restore * removing 204 from operationResults * changes for a monitoring * adding format * removing date-time from duration * changing to readonly * changes for listRPs * fixes swagger * reverting readonly for scheduleTimes * fixes for checkgates * prettier fixes * cahnges for friendlyname checks * fixing gates * removing tracking-via * model validation fixes * powershell changes * adding stable version * changes for PatchResourceRequestInput * change for req fields * changes for description * changes * Updated swagger json for item level restore target info objects * Fixed spelling errors * Added missing required properties * removed auth credentials property * prettier fixes * Prettier fix * pr comments fixes * fixing readme * changes for go readme * Removed x-ms-flatten property (#2) * removed flatten prop * removing x-ms-flatten * removing friendlyName from req prop Co-authored-by: Mayank Aggarwal Co-authored-by: Mayank Aggarwal Co-authored-by: FAREAST\zakinkh * confidentialledger readme t2 config (#13981) * Additional 7.3-preview parameter name clean up (#13913) * Enable multivariate anomaly detection (#13973) * add multivarite * add v1.1-preview * reformat changepoint example * change typo in readme * fix prettier-check error * add export model example * fix prettier error * [Azure Search] Add Knowledge Store feature to swagger (#13911) * introduce knowledge store swagger * add knowledge store to 2020 apis Co-authored-by: Austin Drefke * make skillset count optional, and add it to 2020 GA Swagger (#13990) Co-authored-by: Austin Drefke * Adding support for message properties in ACS Chat (#13939) * Initial commit (copying over stable API version) * Making changes to support message metadata * Added 201 response code for patch operation (#13956) Co-authored-by: Akash Keshari * Adding autoMitigate flag with false as default value (#13109) * deploymentmanager - clean up duplicate parameters outside of method (#13948) * clean up duplicate parameters outside of method * maintain python order * fix typo in Synapse (#13994) * OperationalInsights - update readme files for cli extension update (#13999) * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * added Tables new api version * changed bool to boolean types * prettified jsons * fix erroes in swagger * undo changes to 2020-03-01-preview version * pr fixes * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * changed ErrorResponse to default ErrorResponse without ref to local definition * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed SystemData * creatted a new package containing all latest swagger files for publishing new SDK * removed package 2021_02 and set default packate to 2020_10 * removed 2 packages * removed DataCollectorLogs.json from readme.md 20202.10 * added empty line to try invoke pipeline validations that havent run * Delete Tables.json * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * merge * prettified jsons * undo changes to 2020-03-01-preview version * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed whitespaces * changed DataExportErrorResponse to common .../v2/types.json#/definitions/ErrorResponse * changed all Error response of 2020-08 to common definition * added readme.az.md file for cli extension code generator * added readme.ad.md with the same naming convention as in readme.python.md added readme.cli.md file updatted readme.md file with the new azure-cli-extensions tag all updates were done by following: https://github.com/Azure/autorest.az/blob/9ed1aabd353385f8bdffbfa9f3892478111a029c/doc/how-to-author-readme-file.md * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * added azure-powershell to readme.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * [Cognitive Services Metrics Advisor] add missing required for allOf entities (#13957) * add missing required for allOf entities * fix incorrect required properties * 7.2-Preview to GA (#13919) * 7.2-Preview to GA * Update packages to point to stable * Readd exportable and update description * Update description for exportable in preview versions * Fix operation results contract for Tenant Git operations (#13903) * fix operation results contract * fix sync state contract * iothub t2 readme config (#13980) * iothub t2 readme config * iothub readme t2 config * iothub t2 readme config * Making Offer details and User Details required properties (#13985) * Making Offer details and User Details required properties and removing abandoned tag * fix python configuration * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * cosmosdb t1 config del (#14008) * Fixing issue with missing filter documentation in Access Review APIs (#13892) * fix cred issue. block to merge in DSMainDev (#14014) * fix serivce name for java (#14007) * maintenance readme t2 config (#13982) * maintenance readme t2 config * readme t1 config * [Service Fabric Managed Clusters] fix api 2020_05_01 (#13961) * Use enums and add missing properties * model enum as string Co-authored-by: Alfredo Santamaria Gomez * [Hub Generated] Review request for Microsoft.BotService to add version stable/2021-03-01 (#13784) * add isIsolated and channelSchemaTransformationVersion * rename * add v2 priavatelinks (#14026) * copied from v1/privatelinks.json * bump version Co-authored-by: jianyexi * APIM: improve developer portal operations docs (#13941) * APIM: improve the documentation for dev portal operations * Minor changes * Removing OData parameters from the stable API version * Remove new query params * hotfix on extended location hierarchy (#13943) * [Hub Generated] Public private branch 'wps' (#14002) * Add webpubsub swagger Add custom words Update webpubsub.json Update webpubsub.json Resolve comments Update webpubsub.json resolve comments Update operationId for existence check [wps] update python generation section and client name for all languages (#1) * add python stuff * make title across languages the same * Update version * Update some constraints * Update webpubsub.json * rename to GetServiceStatus * Update readme.md * Update readme.md * Update readme.md * [Hub Generated] Review request for Microsoft.SecurityInsights to add version preview/2021-03-01-preview (#13563) * Copied from 2019-01-01-preview version * Updated references to common types * Add itemsSearchKey field to Watchlists * Add missing label definition * Make itemsSearchKey as required field * Formatting fixes * Fix Prettier and Avocado errors * Fix Lint error (subscription level resource) * Update description and example for CreateOrUpdate watchlists and bulk create watchlist items * Update Api version in examples * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13888) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * updated default package in readme.md to 2021-03 Co-authored-by: Chandrika Gonuguntla * Updated required and default fields in Action Groups spec (#13677) * Updated error response for Action Groups API * spacing * added missing fields to Action Group Resource spec * Added missing fields for action group resource in older version * Updated "resource" name * Removed changes to errorResponse * Removed errorObject * format * Updated required and default fields in Action groups spec * Update default value to boolean Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * changes default value type to boolean * undo webhook receiver changes Co-authored-by: Ritwik Rajendra Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * Remove AML Compute File Server (#13944) * Remove AML Compute File Server * update * update * update * update * Cost Management: Reservation Recommendations API: Add multiple missing properties in specs (#13967) * added totalCost, properties.resourceType, properties.subscriptionId, and eTag to various RiRec dfinitions * moving eTag property to right place * remove duplicate description * remove track1 configure (#14044) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * New API version (2021-02-10) for recovery services site recovery (#13525) * Adding old API version(2018-07-10) to new folder for 2021-20-10 * all changes for swagger (2021-02-10) * read me and custom word changes * Ayesha's comments addressed * adress PR comments from ayesha * Adding suppressions * fixing custom words * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13636) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-02-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * Update readme.md changing read me to include date too in tag * cahnging examples API version to 2021-02-10 * fix read me syntax * TaskStepProperties swagger fix (#13971) * Adding "assignmentState" property to scope model in access review APIs (#14039) * iothub readme.python package version change (#14043) * iothub readme.python package version change * multiapiscript add * clear output folder * Update readme.python.md * Update readme.python.md * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Bump y18n from 4.0.0 to 4.0.1 (#13704) Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update (#14061) * package-templatespecs-2021-03-preview tag added (python) (#13958) * Added tag * nit: ordering Co-authored-by: Dania Etienne * Use 2014-04-01 replication link specs in V5 SDK (#14058) * Use 2014-04-01 replication link specs in V5 SDK * remove legacy file. * Update cSpell.json for Key Vault 7.2 (storage) (#14060) * automanage readme t1 del (#14029) * automanage readme t1 del * automanage readme t1 del * readme.md t1 config del * add missing reference (#13904) * databoxedge readme modification (#14063) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * managedservices t2 onfig (#14064) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13635) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * fixing merge issue * removing vault usages from 2021-02 * Adding back vault usages * updating readme * updated etag to eTag (#13968) * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-12-01 (#13931) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-10-01 to version 2020-12-01 * Updates readme * Updates API version in new specs and examples * Adding new spot VM fields Co-authored-by: Joshua McCarthy * Add FaceAPI PersonDirectory spec updates to preview v1.0 (#13766) * Add FaceAPI v1.0-preview Add a preview version of FaceAPI specs intended for public preview. Contains existing spec in v1.0 plus PersonDirectory feature changes. * Fixes after running validation * Fixing validation * Fixes 2 * Fixes 3 * Add PersonDirectory examples and fix routes * Fixes 4 * Fixes 5 * Fixes 5.5 Co-authored-by: Yang Chen * Update the name and format of a parameter for randomnumbers (#14017) * Update the name and format of a parameter for randomnumbers * Change the parameter name from 'bytes_length' back to 'bytesLength' * Amalladi/extendedlocation update (#13849) * Updating Specification to remove 400 Badrequest from Swagger File * Removing 400 status code from examples * Removing private preview API version from Repo * Removing 2020-07-15-privatepreview tag from ReadME files Co-authored-by: Aditi * maps t2 config (#14075) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * Revert "remove track1 configure (#14044)" (#14047) This reverts commit 867165cc24d81c487ad186c998c46ba55f81c77b. * adding role assignment (#14077) * add connectionPolicy spec back to V5 SDK (#14088) * modification (#14087) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-04-01-preview (#13710) * Adds base for updating Microsoft.DocumentDB from version preview/2021-03-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * adding Services APIs * more changes * updated examples * prettier and readme updates * importing changes missed from old versions * nits * fixing semantic validation * fixing linter * fix * more fixes * adding list operation and default error response * specifying format integer * attempt to fix sdks * address arm comments and fix ci * fixes * fix * try to fix ci * fix examples * .\services.json * adding additionalProperties back to ServiceResouce * adding additionalProperties back to ServiceResouce * fix * fix sdks * fix linter Co-authored-by: Meha Kaushik Co-authored-by: Meha Kaushik * media t2 config(wave4) (#14074) * media t2 config * add packageversion Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.Maps to add version stable/2021-02-01 (#13733) * Adds base for updating Microsoft.Maps from version preview/2020-02-01-preview to version 2020-02-01 * Updates for 2021-02-01 api version swagger * creator swagger fixes * fix model examples * nextLink, uniqueId * build fixes * fixing listkeys * fix long running operations * fixing spelling * fixing async behavior and examples * updating arm region * reset package-lock * [Hub Generated] Review request for Microsoft.Media to add version preview/2021-05-01-preview (#13838) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy Signed off 2021-03-01 swaggers here * Update swaggers to 2021=05-01-preview * add missing examples * update title * fix Operation id * fix video analyzer examples * update Video swagger * add format for $top * remove unnecessary example file * use chackname definitions from types.json * fix segment length readonly * change getStreamingToken to listStreamingToken, getProvisioningToken to listProvisioningToken * fix the example file name * fix a readonly issue with a video property * make type readonly * edits to descriptions * adding missing descriptions * address review feedback, * few cleanup for update class Co-authored-by: Christopher Bennage * Include the preview version of resource changes and resources history… (#14084) * Include the preview version of resource changes and resources history APIs * Address the review feedback on releasing the new package version. * Update readme for Synapse management SDK May release (#14054) * Update readme for Synapse management SDK May release * Add package-2021-05-preview * Address comment Co-authored-by: Dongwei Wang * removing read only property, no longer in use - NOT a breaking change (#13812) * resources readme.python t2 config (#14091) * peering readme t2 config (#14106) * Remove replicationLinks_legacy.json (#14095) PR #14058 removed this file: replicationLinks_legacy.json, removing from the schema config to prevent schema generation failures. * Support sheet index in excel (#14062) * Enable excel in public swagger * update * rollback dataflow change * Support sheet index in excel Co-authored-by: zhanyu2014 * Adding 2021-05-01 api-version to Template Specs (no changes over last preview spec) (#14065) * Copy existing 2021-03-01-preview specs to new 2021-05-01 stable version (no schema changes) * Changing api-version within specs to 2021-05-01 * Adding package tag for new stable version to readme.md, but not making it a default (yet) * Fix SecurityInsights Go SDK versioning (#14030) * Fix SecurityInsights Go SDK versioning * rename stable api version tag * remove 'only' from tags with full functionality * chore: Move typo supression in RecoveryServices (#14120) * Add missing Zone mapping property to Microsoft.Resources (#13936) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * add zoneMappings to ResoursesType * backfill older versions of swagger with zonemapping property * [Application Insights] Resolve duplicated definition names to fix track2 SDK generation error (#13951) * Fix duplicate name * Update readme.md * Update readme.md * Update and rename workbookOperations_API.json to aiOperations_API.json * Update readme.md * Update workbooks_API.json * Update readme.md * Update readme.python.md * Update readme.md * Update readme.md * Update readme.md * Rename aiOperations_API.json to workbookOperations_API.json * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update swagger for SSIS-IR to support user-assigned managed identity (#14114) Co-authored-by: Hongxian Yao * postgresql readme t2 config (#14067) * Dev mediaservices microsoft.media 2021 05 01 (#13676) * Adds base for updating Microsoft.Media from version stable/2020-05-01 to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * [AMS] new 2021-05-01 release for Account service in AMS * add missing example files * fix the api version and missing example files * Create a new Update definition to fix the "R2016 - PatchBodyParametersSchema " * fix respnse * fix update example * add the 2016 supression for new tag as well. * mixedreality t2 readme config(wave4) (#14105) * mixedreality t2 readme config * t2 config del * [python] t2-confidentialledger config (#14144) * Update readme.python.md * Update readme.python.md * Update readme.python.md (#14145) * update elastic swagger (#14076) * Update elastic.json * added new examples * taking the files from rpsaas master * added suppression in readme * [Cosmos DB] Introduce new api version 2021-04-15 (#13873) * [Cosmos DB] Introduce new api version 2021-04-15 Initial Commit * Updated for 2021-04-15 * Dummy Commit * Fixing privatelinkresources.json * Removing ErrorResponseUpdatedFormat * Suppressing systemData check * Relay - Fix typo in the NetworkRuleSet path (#13962) * Relay - Fix typo in the NetworkRuleSet path * Suppression - DefaultErrorResponseSchema - we will be Implementing in new API version * [Hub Generated] Review request for Microsoft.Portal to add version preview/2015-08-01-preview (#12732) * Fixing properties in dashboard parts * Updating Dashboard part metadata * Updating based on prettier fixes Co-authored-by: Himanshu Chandel * resources t1 config add (#14146) * t1 config add * package version * [Hub Generated] Public private branch 'dev-maintenance-Microsoft.Maintenance-2021-05-01' (#14148) * Adds base for updating Microsoft.Maintenance from version preview/2020-07-01-preview to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * Added system data properties. * Fixed lint error. Added documentation. * Use Host Maintenance scope and api version in exmaple. Co-authored-by: Kalpesh Chavan * Add Test Base Swagger Spec from RPSaaSMaster (#14113) Co-authored-by: Bin Yu * rename property: change category to categories (#13883) * Edit description of Update Iot Hub Resource Api (#13080) Co-authored-by: Harini * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13889) * Adds base for updating Microsoft.RecoveryServices from version stable/2018-07-10 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Update webpubsub.json (#14096) * add dataFeedId in AnomalyResult and IncidentResult (#14127) * add dataFeedId in AnomalyResult and IncidentResult * fix examples * Add new version 2021-03-31-preview1 for ACS Auth (#13965) * Add new version 2021-03-31-preview * Set required body * Add all paths to new version * Update description for property of TeamsAccessTokenRequest model * Change version from 2021-03-31-preview to 2021-03-31-preview1 following standards https://skype.visualstudio.com/SPOOL/_wiki/wikis/SPOOL.wiki/16790/Versioning * Rename folder * Update method description * remove Turn endpoint * Add examples * Update readme * Omit the word "skypetoken" from swagger * Link example * Update description and path for a new endpoint Co-authored-by: Alexandra Lamiova Pistrakova * Added example gneration document links (#14151) * purview scanning service (#14021) * purview scanning service * Add custom words for spellcheck * fix config files and add endpoint param Co-authored-by: Parv Saxena Co-authored-by: iscai-msft * MG RP new API versions: 2020-10-01 and 2021-04-01 (#13897) * API 2020-10-01 with 2020-05-01 files * 2020-10-01 API changes * 2021-04-01 API version with 2020-10-01 files * Changes for 2021-04-01 API * PR fixes * Fixed issues with model * PR fixes * Latest (#13917) * Pick up previous Swagger Fix in 2019-09-01 version (#14092) * Add missing swagger fix * Fix bad copy-paste * update the some capitalized words in the description * Adding EventData schema for Microsoft.Storage.BlobTierChanged event (#14049) * Adding EventData schema for Microsoft.Storage.BlobTierChanged event * Removing contentLength/Offset from Microsoft.Storage.BlobTierChanged data schema * Removing BlobTierInfo from BlobTierChanged and adding new event Microsoft.Storage.AsyncOperationInitiated * adding ContentLength for BlobTierChanged and AsyncOperationInitiated events * [Hub Generated] Review request for VideoAnalyzer.Edge to add version preview/1.0.0 (#13682) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy old LVA swaggers * Rename old swaggers to new file names * Update LVA swaggers with new AVA swagger * fixed some paths and capitalization * fix prettier check issues * fixing a Pascal casing * Updating swaggers to latest * fix linting issue * removed an unused definition * Service fabric Client API 8.0 (#14011) * spell checked and linted. * updated tag version. * reverted change outside of SF folder. * updated version in swagger. * changed credential issues. * changed 1 more that looks like a credential. * Kusto pools principal assignment (#14079) * kustoPool PrincipalAssignments * fixed list principal assignments * principalAssignment list example * principalAssignment get example * KustoPoolPrincipalAssignmentsCreateOrUpdate * KustoPoolPrincipalAssignmentsDelete * databases PrincipalAssignments * minor change * KustoPoolDatabasePrincipalAssignmentsList * KustoDatabasePrincipalAssignmentsGet * KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate * KustoPoolDatabasePrincipalAssignmentsDelete * fixed example ref * added system data * kustoPoolCheckNameAvailability * KustoPoolsCheckNameAvailability example Co-authored-by: Itay Sofer * [Service Fabric Managed Clusters] fix api 2021_01_01-preview (#14012) * Update preview api to disable broken properties and to add property that is working * Update managed cluster description * Add New Data Model RuleCollection to NetworkManager (#13827) * Add New Data Model RuleCollection to NetworkManager * fix typo * test * test * Fix discriminator * fix type * Fix discriminator * Fix type * fix type * Fix type * Fix discriminator * Fix discriminator * fix type * fix type * Fix bug * Fix type * Fix format * Fix name * Fix name * fix spell * fix description * Fix spell * change to kind * fix lint * fix lint * fix lint * fix lint * fix lint * fix lint * Fix post body * Fix as comments * fix bug * fix bug * fix bug * fix bug * fix bug * fix bug * change rule kind * Fix as comments * Fix as comments * update lastest version * Update type * Update Skiptoken * Fix discription * Fix NG * Fix NG * add more example * [python]Update readme.python.md for postgresql (#14182) * Update readme.python.md * Update readme.python.md * Remove all schema readme (#13885) * Remove all schema readme * process new rp * Remove after_scripts * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2021-04-01 (#13890) * Adds base for updating Microsoft.AlertsManagement from version stable/2019-06-01 to version 2021-04-01 * Updates readme * Updates API version in new specs and examples * first commit * some fixes * try without alert management * revert change to name of namespace * Resolve lintdiff issues * remove the copy of files and reference alert managment previous version * update description of subscriptionId to solve error * attemp to remove AlertsManagement from the package * revert (put back AlertsManagment) * add tags for go SDK release v54.0.0 (#14161) * add tags for go SDK release v54.0.0 * add a new tag * FRv2.1 GA Stable Release (#13997) * Standardized Errors, sample list. * removing from master from now as this is just a proposal * FRv2.1 GA Initial commit. Co-authored-by: Sandeep Parab * remove extra / from host template (#14176) * [Hub Generated] Review request for Microsoft.Batch to add version stable/2020-09-01.12.0 (#14170) * [Batch] Update RemoveNodes description to include max nodes/request * Added suppressions to readme * Update swagger for a new version 2021-03-31-preview1 for ACS Auth (#14168) * Unify names * Update tag * Update due to review meeting * update example description Co-authored-by: Alexandra Lamiova Pistrakova * Add new 1.0 version for IoT Central API (#13713) * Add new 1.0.0 version for IoT Central API * fix swagger style * fix wrong json file name * remove unused examples * revert back email format * remove non-used examples * update with latest examples * update preview from 2019-10-28-preview to 2021-04-30-preview * remove extra --- * update version from 1.0.0 to 1.0 * rollback collections for common entities * update _id to Id, update _name to Name from operation, add sdk generation * fix go sdk file * remove go sdk * updatedevicve_templateId to deviceTemplateId * Add query parameter based versioning, remove resource schema * fix example docs reference * fix typo in comments * renaming execute to run for command operations * add api-version to samples files, fix devices_update missining issue * add devices_update.json for 1.0 * fix rerun_id, add missing parameters to examples for preview, fix command comments from execute to run * fix annoymous type issues * add title to readme. (#14179) * videoanalyzers-fix-missing-host (#14181) * New API version for Microsoft.Resources stable/2021-04-01 (#14132) * base for Microsoft.Resources 2021-04-01 * update readme * update api version * API changes for S2S * readme Co-authored-by: Wendy Chang * Swagger Changes for Get Recoverable Servers and create server with Geo-Restore. (#14013) * Added Recoverable Servers API and GeoRestore API. * Fixed spell check and prettier * Fixed readme.md file issue and changed the postgreSQL to restore. * Fixed duplicate schema issue. * Fixed the mismatch with namespace names. * change the tag name from georestore to servers * Fixed the SDK validation issues. * Fixed objects w.r.t preview version * Fixed operation required properties. * Included 2020-04-10 in the SDK versions * Change the folder path. * Add missing multiapi entry for go sdk v54.0.0 release (#14200) * add missing multiapi entry * fix one output-folder * Azure security insights - add data connectors preview version (#13998) * add new API * ad name to enum * updatre defenition names * update readme * update readme * update readme path files * fix errors * add missing connectors * execute validation * execute pre * update readme * add description ans x-ms-enum * update description * update properties * add description * rename enum - fix new error that didnt display until now * rename enum unser x-ms-enum property * [Hub Generated] Review request for Microsoft.Maps/Alias to add version preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0 and preview/2.0 (#13921) * Copy Creator API 1.0 to 2.0 * draft of planB * adding ontology properties; adding DataUpload * updated alias apis * put v1 API back so diffing is easier * reapplying v2 so diffs are easier * remove type from datasetsources * incorporate suggestions from review board * adding ontology field * Update alias v2 apis. * fix conversion descriptions, update alias * Fix the alias file. * Add get details example. * fix casing on headers; mapData more consistent * minor comment and linting fixes * Adds base for updating Microsoft.Maps/Alias from version preview/1.0 to version 2.0 * Updates readme * Updates API version in new specs and examples * Add baseline from preview/1.0 * update api-version in examples * add v2 files to readme * fix avacado errors * Adding string length limit to the descriptions for feature state. Adding string length limit to the descriptions for feature state. * Adding ontology element to the WFS resopnse examples. Adding ontology element to the WFS resopnse examples. * Updating length to 1000 from 1024. Updating length to 1000 from 1024. * Update dataset v2 descriptions and examples. * Update the examples to have the right details. * reran linter; added spellcheck words * more linting: 202 description alignment * fixed example linting for alias, data, dataset * example linting changes for conv, fs, tileset * change featurestateset patch to put * autorest linting fixes * Reverting FeatureState body to include array to match V1 body and response. * adding missing operationIds * added examples; more linting * remove x-ms-long-running * Update alias documentation for resourceId -> creatorDataItemId change Co-authored-by: Robert Johnson Co-authored-by: Subbarayudu Kamma * Update attribute name for message metadata (#14206) * Update attribute name for message metadata * Apply Prettier * Prettier fix Co-aut… * update-typescript.md (#17182) * Microsoft.OperationalInsights: Adding missing references to new package. (#17244) * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * code review changes. * Update Tables.json * Update Tables.json * OperationalManagement: 2021-12-01-preview * more fixes. * Update Clusters.json * Tables: Sentinel+CLV2 changes. * Tables: More descriptions. * removing un related child resources. * Create OperationsListByTenant.json * Update Tables.json * Update TablesGet.json * Add systemData example. * Model fixes + pretty * adding description to ip data hint. * Update Tables.json * Microsoft.OperationalInsights: Updating package reference list. Co-authored-by: Dudi Likvornik * add missing Configuration Tags to operationalinsights readme (#17196) * [Hub Generated] Review request for Microsoft.ContainerInstance to add version stable/2021-10-01 (#16959) * Adds base for updating Microsoft.ContainerInstance from version stable/2021-09-01 to version 2021-10-01 * Updates readme * Updates API version in new specs and examples * adding new json property dnsNamelabelReusePolicy * modify the type of dnsnamelabelreuse * adding unkown words to word list * modify readme page to make accurate * add version to readme.go.dm file * making edits to readme file * reverting changes to other files * running prettierCheck only on specific file addition * update example script as well * running prettier check on example json file * changing DnsNameLabelReusePolicy modelAsString to true * Web ant95 2021 03 01 (#16506) * Adds base for updating Microsoft.Web from version stable/2021-02-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Re-add Microsoft.CertificateRegistration and Microsoft.DomainRegistration APIs since they do not get pulled in by OpenApiHub (#15917) * Introduce enterpriseGradeCdnStatus to StaticSites.json (#16080) * Update StaticSites.json * Update StaticSites.json * Onedeploy API swapper spec (#15985) * Onedeploy API swapper spec * Adding onedeploy custom keyword * Formatting onedeploy api indentation Formatting onedeploy api indentation * prettifier Co-authored-by: Calvin Chan * Fix status codes for syncfunctiontriggers (#16413) * Add GET endpoint at /config/authsettingsv2 for Microsoft.Web (#16427) * Add GET endpoint at /config/authsettingsv2 for Microsoft.Web * Fix duplicate operation ids * Swagger for ASD Transfer out (#16000) * Add domain transfer out to swagger * Prettifier * Add 202 response for webapp restart * Add certificate listHostnameBindingsOfCertificate * Formatting * Swagger for listHostnameBindings endpoint (#16516) * Swagger for listHostnameBindings endpoint * Re-add Microsoft.CertificateRegistration and Microsoft.DomainRegistration APIs since they do not get pulled in by OpenApiHub (#15917) * ops Co-authored-by: Naveed Aziz * User/jennylaw/containerapp (#16657) * Pre-Prettier-commit * Adding missing file * Prettier fixes * Add missing definitions * Fix intendation in readme.md * add suppressions * Add custom hostname sites endpoint (#16745) * Add custom hostname sites endpoint * Fix models * Swagger Fixes for Container App, KubeEnvironments spec (#16793) * Pre-Prettier-commit * Adding missing file * Prettier fixes * Add missing definitions * Fix intendation in readme.md * add suppressions * Fix Kube Environments 2021-03-01 contract + add list secrets api to Container Apps Swagger * Fix sercret read property * Prettier fix * Model fix * Prettier Fix #2 Co-authored-by: Jenny Lawrance * Add long running extension for restart (#16791) * Remove unused API from ANT95 swagger (#16901) * Address PR comments (#17019) * Fixing PR comments (#17127) * Remove Certificate Hostname bindings API (#17204) * Remove Certificate Hostname bindings API * Remove examples file as well Co-authored-by: mkarmark Co-authored-by: SatishRanjan Co-authored-by: Calvin Chan Co-authored-by: Connor McMahon Co-authored-by: JennyLawrance Co-authored-by: Sanchit Mehta * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2021-10-01 (#17013) * fixing s360 for these * fixing styling issue * Adding 204 to examples * Fixing the model val for reservation by adding proper guid Co-authored-by: Mita Garg * Update document of OAV error definitions (#17206) * Update document of OAV error definitions * Added reference link in description * [Hub Generated] Review request for Microsoft.DataFactory to add version stable/2018-06-01 (#17189) * Add FailActivity in swagger Pipeline.json for Azure Data Factory * Update description of FailActivity * Adding 'type:object' to FailActivity and FailActivityTypeProperties * Dev powerbidedicated microsoft.power b idedicated 2021 01 01 (#16840) * Apply PowerBIDedicated correctness fixes to 2021-01-01 * Move PowerBIDedicated properties to new definitions * Keep ErrorResponse inline with documented expectation * Update for ModelValidation failures * cleanup operations example * Compute add batch tag package-2021-08-01 (#17254) * Update readme.python.md (#17255) * Update readme.python.md (#17256) * Update readme.md (#17257) * Update readme.python.md (#17258) * Update readme.python.md (#17259) * Update readme.python.md (#17260) * Review request for Microsoft.MachineLearningServices to add version preview/2022-01-01-preview (#17079) * Copy latest version 2021-07-01 to new version 2022-01-01-preview without change * apply changes for new preview API * remove unrelated changes to new preview API * address comments * fix name spell Co-authored-by: Xi Jin * [Go] Track2 modify videoindexer (#17037) * [Go] Track2 modify videoindexer * move the deduplication * remove deduplication to see what happens * remove go track1 config * remove readmd.go go repo config * remove readme.md version Co-authored-by: ArcturusZhang * Subscription RP v2021-10-01 endpoint fix, s360 correctness (#17155) * Copied the last item from private repo and renamed to 2021-10-01 * Updated the version to 2021-10-01 * Error response is updated. It is required by OpenAPI Validation Tools(linter) * http status response on post method is updated to 201 from 202; required by OpenAPI Validation Tools(linter) * description is added in #definitions.Operation.properties.display; required by OpenAPI Validation Tools(linter) * updated error response to match it previous * systemData properties are added; required by Swagger validation on the PR * updated readme.md for the new version * removed a file getSubscriptionOperation.json as long as it is not referenced; required by Swagger Avocado on the PR * Modified style by npm prettier * executed npm run prettier; required by prettier check on PR * added type:object; required by swagger LintDiff * added type:object; required by swagger LintDiff * reverted back the post response of acceptOwnership to 202 * http status response on post method is updated to 201 from 202; required by OpenAPI Validation Tools(linter) * reverted back the post response of acceptOwnership to 202 * Updated property name value to subscriptionId * Added missing property in response body of Get List of Alias subscription API * Updated response of default policies from 201 to 200 based on API response * Updated example for response of default policies from 201 to 200 based on API response * s360 fix: error response is fixed on managementpartner * added Microsoft.Subscription/stable/2016-06-01/subscriptions.json in input file list * Lint diff errors are fixed * reverting back the changes for 2-16-06-01 * added v2016-06-01 for the new * executed prettier Co-authored-by: Ochi * KeyVault: Add OKP/EdDSA support to version 7.3-preview (#17251) * add x-ms-enum for orbital (#17238) * Fixed property names (#17222) * config readme (#17276) * config readme * Update readme.md * Microsoft.OperationalInsights: Renaming Upsert command to CreateOrUpdate (in accordance to convention) (#17265) * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * Microsoft.OperationalInsights: tables privatepreview * code review changes. * Update Tables.json * Update Tables.json * OperationalManagement: 2021-12-01-preview * more fixes. * Update Clusters.json * Tables: Sentinel+CLV2 changes. * Tables: More descriptions. * removing un related child resources. * Create OperationsListByTenant.json * Update Tables.json * Update TablesGet.json * Add systemData example. * Model fixes + pretty * adding description to ip data hint. * Update Tables.json * Microsoft.OperationalInsights: Updating package reference list. * Tables: Changing operation description. * removing in correct read only indication. Co-authored-by: Dudi Likvornik * Adding ReadOnlyDatabase object to Synapse model. (#17213) * Adding ReadOnlyDatabase object to Synapse model. * Adding type:object to ReadOnlyDatabase and to its properties. * fix python pipeline failure * fix python pipeline failure Co-authored-by: Amir Dachabash Co-authored-by: Yuchao Yan Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * [SRP] Add "2021-08-01" API version (#16659) * Copy the spec from 2021-06-01 to 2021-08-01 * Apply the API and property changes in 2021-08-01 * Fix format * Update readme and add tag 2021-08 * Add isLocalUserEnabled and isSftpEnabled properties; add examples for ActiveDirectoryProperties * Fix missing bracket and format issue; add required properties for permissionScopes * Create readme.python.md * Remove unreferenced file * Add explicit type:object * Add default responses and system data field * Fix example of Create Local User * Update descriptions * Remove secret tag * Revert "Remove secret tag" This reverts commit 45b1c7b6b82998b4f470615efd2c5d453cd6f4b7. * Update LocalUserCreate.json * Update the local user properties definition * fix readme * apply #17027 to this PR Co-authored-by: Yuchao Yan Co-authored-by: Arcturus Zhang * Updated json files to reflect that ReadScale and HighAvailabilityReplicaCount properties are not supported on pooled vldbs or any elastic pool other than Hyperscale. (#17274) Co-authored-by: Christian Valencia * config oep readme python (#17291) * config labservice readme python (#17292) * config botservice readme python (#17294) * fix x-ms-client-name (#17290) * Modified description of maxTaskRetryCount to include default value and clarify infinite retries (#17293) * Added Changes to fix S360 issues (#17064) * fix changes * added 202 example * Fix update * fixed issue * fixed * added type * Add example for update application Co-authored-by: Ayush * [Hub Generated] Review request for Microsoft.KeyVault to add version stable/2021-10-01 and preview/2021-11-01-preview (#16156) * Adds base for updating Microsoft.KeyVault from version preview/2021-06-01-preview to version 2021-10-01 * Updates readme * Updates API version in new specs and examples * Keys.json done * keyvault.json done * Readd systemdata * Fix keyvault.json * Add type: object to missing definitions except MHSMs. * Fix * Fix * Add type object to MHSM * Remove 404 responses from new api-version * Merge new preview version 2021-11-01-preview * Readd 2021-10-01 to readme * Add changes for key rotation to new preview api version. * Add x-ms-enum as per request from SDK team * Fix duplicated value * sync RPSaaSMaster branch to main branch (#17166) * copy previous version * changes to 08-30 version * copy previous version * changes to 09-10 version * add reference * revert 06-15 to have headers * fix typo * typo Co-authored-by: Ping Zhu * Fix response code in spec to correct reflect the approve or reject private endpoint connection API's behavior (#17015) * added fix * Update ApiManagementApproveOrRejectPrivateEndpointConnection.json Updated Example * add java directive to security insight (#17295) * Revert "[DO NOT MERGE ] Introduce new scanners resource type (#17107)" (#17232) This reverts commit 30fca88fa23112e4296322f38610e02da522d390. * Add Check zone peers to Subscription.json (#17050) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * add checkZonePeers to subscription.json * fix linter and prettier errors * fix spelling errors * fix spelling and descriptions * add descriptions * fix linter issues * fix error responses * fix syntax errors * add description * add reponse body * revert changes to package-lock * Update readme.python.md Co-authored-by: Yuchao Yan * [Hub Generated] Public private branch 'dev-hsm-2018-10-31-preview-SKUChangesOnly' (#17297) * Add more SKU enums * Fix avocado and spellcheck errors * PHSM: Swagger: Copy the current private preview files\folders to a new folder: 2021-11-30. * Add managementNetworkProfile to properties. Introduce API version 2021-11-30. * Fix avocado errors * Fix LintDiff error to add SystemData to the resource. * Add VNET outboundnetworkdependencies GET. * Addressed the review comments * Added x-ms-identifiers as a newly introduced rule in LintDiff was complaining * change codeowners (#17317) * Add swagger definitions for deletedAutomationAccounts resource type (#17169) * add swagger definitions for deletedAutomationAccounts resource type * fix semantic and model validation error * fix model validation error * fix date format and schema type * fix lint diff error * fix paths * fix lint diff * remove errorresponse schema * add errorresponse schema * add reference in readme * supress error schema * fix URI path to return list of deleted accounts * remove automation account name parameter Co-authored-by: Ravi Yadav * add x-ms-enum (#17225) * Creates a new swagger file to implement the 2022-01-11-preview2 SDK version. (#16884) Co-authored-by: Lucas Santos * Add TranslatorBatch API v1.1 (#16705) * add API v1.1 * Match v1.0 swagger * Remove unneeded changes * Address PR failures * Update readme * Update @failedDocumentStatusLink name * Fix swagger examples * Fixing swagger examples * Fix swagger * Address board review comments * move options to target level * remove the @ from failedDocumentStatusLink * switch the pdf output options to enum * Remove failedDocmentsStatusLink field from response * Update TranslatorText Readme file * Add collectionFormat Co-authored-by: Fady Essam * Introducing new API version 2021-11-01 for Azure Site Recovery service (#17275) * Initial commit with 2021-10-01 version * New API version 2021-11-01 for Azure Site Recovery * Add Readme changes * Add "x-ms-long-running-operation-options" * Update pull_request_assignment.yml (#17075) * Fixing the incorrect description of a field (#17262) * Fixing the incorrect description of a field * Revrting change for older apis * [Go] add directive to rename (#17323) * [Go] add directive to rename * format directive * sku * [Go] Add batch tag 01/13/22 (#17332) * Doc update for speech-to-text v3.0 API (#17158) * Doc update for speech-to-text v3.0 API * Run prettier check * Update SDK client names (#17329) * update word for OpenApi Hub related info (#17335) * Review request for Microsoft.BotService to update version stable/2021-03-01 and Preview/2021-05-01-preview (#17112) * fix S360 issue * update * updatge * update * Zhixzhan/botservice spec patch fix (#1) * Add ActionType according to arm-rpc (#17078) * Add ActionType according to arm-rpc * add stable API version * add new rule XmsIdentifierValidation doc (#17076) * add new rule XmsIdentifierValidation doc * fix comment * fix comment * fix comment Co-authored-by: Tianxiang Chen * Creating new version( 2021-11-15) for passive stamp (#17044) * Adds base for updating Microsoft.RecoveryServices from version stable/2018-12-20 to version 2021-11-15 * Updates readme * Updates API version in new specs and examples * updating readme.md for C# * updating the api version * updating tag * updating active stamp tag * changes to fix checklist failures * changes to fix checklist failures-2 * Add batch tag for release track1 (#17111) * Adding 202 response code VM Patch operation.... (#16988) * adding 202 * 202 response for patch * example * [Go]Track2 modify readme.go.md 11 (#17099) * [Go]Track2 modify readme.go.md 11 * add go multiapi * remove addons * add directive * fix * beta to preview output-folder * Release microsoft.sql 2021 08 01 preview (#16968) * Adds base for updating Microsoft.Sql from version preview/2021-05-01-preview to version 2021-08-01-preview * Updates readme * Updates API version in new specs and examples * update default client tag to v5 * Generate the 2021-08-01-preview files from DSMainDev and commit * add new added ipv6 and example files * change "jobExecutionId": "5555-6666-7777-8888-999999999999" to "jobExecutionId": "5A86BF65-43AC-F258-2524-9E92992F97CA" in example files to pass the type validator * Add ListOperations.json example file * pass formatter npm pretty * update instanceFailoverGroups in the type of example files * remove ipv6 batch replace api due to arm concern. it will be in next version. * add x-ms-enum * Remove custom `ResourceGroupNameParameter` and replace them with the one from common-types (#16944) * remove custom resourceGroupNameParameter and replace them with the one from common-types * fix * move the directive that meant to work for go track 1 to readme.go.md * Revert "move the directive that meant to work for go track 1 to readme.go.md" This reverts commit bc9c13f8acdec3c8f29e5cd4a87bcefbfcf61f3a. * test * revert * add tag condition back * [Go] Delete saas track1 config (#17113) * [Go] Delete saas track1 config * fix * Update Go readme (#17061) Co-authored-by: Anat Gilenson * Added ParentId response header to File/Directory rename (#17119) * Revert dataset spelling change (#17124) * Dev datamigration microsoft.data migration 2020 09 01 preview (#16032) * Adds base for updating Microsoft.DataMigration from version stable/2021-06-30 to version 2020-09-01-preview * Updates readme * Updates API version in new specs and examples * add examples and change swagger * camel casing error (removing the resource since it is redundant) * added "systemData" property to the response of sqlMigrationService * adding isDataAction property in operationsDefinition * fixing Avocado error : removing unreferenced files * styling changes * adding systemData to DatabaseMigrations * suppressing lintDiff * Revert "styling changes" This reverts commit 4cba4308e6b3b4f35144f6ae28b4c760cd6f90f8. * formatting changes (after running npm run prettier) * adding v1 apis * adding v1 apis * Revert "adding v1 apis". Bad update This reverts commit 99b1f84465749a4948ece4cacfb63652b0cd5a4e. * Revert "adding v1 apis". Bad update This reverts commit 795344a819d2d72f3c86c3714274df48f5303205. * adding v1 paths in v2 spec * adding stable-2018 apis * updating api version in definitions * avocado error : removing unreferenced files * suppressing lintdiff errors R4013 and R4037 * removing subscriptioid parameter from v1 and referencing to susbscriptionid parameter from v2 (to resolve conflict) * adding v1 apis as a separate json file * adding a missing example for v1 spec * removing duplicate api (get operation) from v1 spec * Revert "removing duplicate api (get operation) from v1 spec" This reverts commit 545e6ff29239d3b33f393af8b8c4fd4021cebe1f. * avocado error : api versions correction * avocado error : adding definitions in readme and changing api version in v2 spec to 2020-09-01-preview * adding missing definitions and removing extra definitions in readme * removing operation path from v1 spec * trial : trying merging with 2021 stable version * nit errors in readme * updating api versions in definitions of 2021 stable version * removing operations api from v1 (stable 2021) * changing sqlMigrationInfo to sqlMigrationInformation in v2 swagger * Renaming FileShare to SqlFileShare in v2 spec * Renamimg BackupFileInfo to SqlBackupFileInfo in v2 spec * renaming BackupSeiInfdo to SqlBackupSetInfo in v2 spec * Renaming TrackedResource to TrackedResourceARM in the v1 spec * deleting duplicate subscriptionId parameter in v1 * sqlmigration casing error * referencing SystemData definition from the v2 spec * avacado error : removing unreferenced file Operations_List.json * adding custom-words.txt file * reverting adding custom-words.txt * exchanging positions of sqlmigration and datamigration in readme * adding sqlmigration in custom-words.txt * adding systemData to TrackedResource in v2 removing TrackedResourceARM from v1 and referring to v2 TrackedResource instead * adding "x-ms-azure-resource": true extension in DataMigrationService and Project definitions in v1 * changing veersion from 2020-09-01-preview to "2021-10-30-preview" * manually changing api version (to 2021-10-30)in readme * adding ooperations api to v1 spec * adding the subscriptionId parameter in v1 spec * adding operations_list in the examples (for v1) * Revert "adding ooperations api to v1 spec", adding the subscriptionId parameter in v1 spec, adding operations_list in the examples (for v1) This reverts commit b94a96d8f48edef45967a57050e09eb27f9ea0de, 40e80e0d2a8e9fab72443e3893a9f0712c224f0a, 7be34463aaf58418f4574d3df9288e64cd27c5e4 * removing x-ms-azure-resource extension * Revert "removing x-ms-azure-resource extension" This reverts commit 8bf42972d7a1f3e5f8f1f4bf0d1fad19b77a161c. * add subscriptionId to v1 spec * Revert "add subscriptionId to v1 spec" This reverts commit e3e729be0b1124875e279d9d718d8226dba2f8b8. * removing read only : true for systemData properties * setting readonly to true in systemData definition in v2 swagger. (note : the chnages in v2 swagger are done manually for now, change these from the RP side too) * renaming the specs to check if having the name datamigration.json has some importance * Revert "renaming the specs to check if having the name datamigration.json has some importance" This reverts commit a68c0c07d2a3f9932310eb910a683d1e824d7dfc. * adding "x-ms-azure-resource": true to trackedResource and removing it from datamigrationService and Project definition as they extend from trackedResource * correctly placing "x-ms-azure-resource": true * prettier check error on sqlmigration.json * referencing systemData from common-types/resource-management/v2/types.json#/definitions instead from v2 spec (to see if that affects the systemData error in cross-version) * Revert "referencing systemData from common-types/resource-management/v2/types.json#/definitions" This reverts commit 94641f1b36cc7828ea8efd21f4df89c282f51941. * keeping subscriptionId parameter in both specs (by renaming it in v2) * renaming subscriptionId to subscriptionIdParameter in the paths of v2 * casing error * using subscriptionIdParameter instead of subscriptionId in the examples of v2 * renaming subscriptionId to subscriptionidParameter in v2 example * Reverting the changes related to keeping subscriptionId parameter in both specs This reverts commit fa22043a2b4ca284466bacda244f19c087a78718, 13d549928711b2d85e776f0680a7347242582ac2, 2755f643ed32b766fbb98ed6a7fd814211aecea3, 6e74171367ddf0a4a9f7a6b36b8f41a65a2c7701, f3142b41b841793ae409a7e2d89d9bc4c262e9e7 * update tag in readme * renaming trackedResource to trackedResourceARM in v2 and restoring the trackedResource in v1 * Revert "renaming trackedResource to trackedResourceARM in v2 and restoring the trackedResource in v1" This reverts commit 269a4c3305c6e282bfa192b162b959d1b8083033. * removing system data and x-ms-azure extension from tracked resource (because making changes in the tracked resource will involove dsMianDev repo changes) * adding "x-ms-azure-resource": true to trackedResource of v1 * adding "x-ms-azure-resource": true to dataMigration service and project (because of the error : The 200 response model for an ARM PUT operation must have x-ms-azure-resource extension set to true in its hierarchy. Operation: 'Services_CreateOrUpdate' Model: 'DataMigrationService'. Location: Microsoft.DataMigration/preview/2021-10-30-preview/datamigration.json#L97) also, removing x-ms-azure-resource from trackedResource * Revert "adding "x-ms-azure-resource": true to trackedResource of v1" This reverts commit bd0fb9c3bb96a736712baaa71efd2e91c49375c0. and f2440eef137d7771217b9924ce941e876363afe9 (bad commit) * Revert "removing system data and x-ms-azure extension from tracked resource (because making changes in the tracked resource will involove dsMianDev repo changes)" This reverts commit e330db6a6abe2209d8d28a07da295267a036a9de. SystemData is required to be in trackedResource * Adding Scope Parameter to examples * Revert "Adding Scope Parameter to examples" This reverts commit b6c827585bb509306f2082e5686b31ee0333b182. * Adding Scope parameter in response of SqlMiGetDatabaseMigration.json * Adding Scope Parameter to other examples * ARM: Adding x-ms-secret: true to password (SqlFileshare and SqlConnectionInfomation), accountkey, authkey1 and authkey2 * Adding x-ms-pageable to DatabaseMigrations_ListByScope, Operations_List, SqlMigrationServices_ListByResourceGroup, SqlMigrationServices_listMigrations, SqlMigrationServices_ListBySubscription * Removing x-ms-secret from Authkeys * Adding x-ms-secret to authKeys in AuthenticationKeys and RegenAuthKeys defination * Suppressing Secret_Property model validation error * Adding suppress SECRET_PROPERTY in Suppression section * changing GET getMonitoringData to POST listMonitoringData * Removing location property from DatabaseMigration definition * New Cancel\Cutover operations with MigrationOperationId in Request body. * updating examples for cancel and cutover operations * Chaning SqlMigrationService_GetResourceState to SqlMigrationService_Get * Revert "Chaning SqlMigrationService_GetResourceState to SqlMigrationService_Get" This reverts commit d16dc91a39245cecc4289b206af070eccb74b783. * Changing GetResourceState to Get * Adding 2 namespaces 2 SqlMi Migration API and updating examples * Add Vm APIs, change operation Id of Mi and VM APIs and Update examples * Suppressing list by subscription DatabaseMigration LintDiff error * Adding discriminator to databaseMigrationProperties in order to separate SqlMi and SqlVm migrations * [nit error] changing SqlConnectionInfo to SqlConnectionInformation * nit error * updating the example SqlMiGetDatabaseMigration.json to use"kind" in order to resolve the error : Additional properties not allowed * updating all Mi and Vm examples to use "kind" in the properties * styling changes (for prettier check) * updating listMigrationsByService.json xample to use kind property * running prettier check * adding other properties in request along with kind in sqlVmCreateOrUpdateMax.json example * Revert "adding other properties in request along with kind in sqlVmCreateOrUpdateMax.json example" This reverts commit 8a47679fa45846b8bc41d7651c7c91e2f7ef943c. * keeping both kind and other properties in the request body for sqlMiCreateOrUpdateDatabaseMigrationMax.json * keeping both kind and other properties in all the examples * adding enums for commandType and taskType discriminator * adding x-ms-enum for commandType and taskType (v1) * adding remaining enum values for taskType and commandType * Removing List By Scope APIs for Mi and VM * Remove Delete APIs for SqlMi and SqlVm * Making DatabaseMigrationSqlVm_Cancel a x-ms-long-running-operation * Moving common properties to DatabaseMigrationProperties * Creating ResourceClass for SqlMi and SqlVm and updating the APIs accordingly * Suppressing LintDiff errors for SqlMi and SqlVm Resource Classess * Making x-ms-client-flatten: false for DatabaseMigration and other SqlMi and SqlVm Resource Class * updating parameters in examples: Services_checkChildrenNameAvailability.json and Services_CheckNameAvailability * v1 s360 errors * object_missing_required_property error: updating example services_Start.json * revert 81733a02cc88d52d69497fff3a5b7abafadedeee * prettier check * reverting all chnages related to "v1 s360 errors" * v1 s360 errors: adding missing properties to mongoDbConnectionInfo in common.json * nit error * v1 s360 errors: adding missing properties to sqlConnectionInfo in common.json * v1 s360 errors: adding missing properties to mySqlConnectionInfo in common.json * v1 s360 errors: adding missing properties to PostgreSqlConnectionInfo in common.json * v1 s360 errors: adding missing properties in MigratePostgreSqlAzureDbForPostgreSqlSyncTask.json * v1 s360 errors: removing problematic property from MigratePostgreSqlAzureDbForPostgreSqlSyncTask * v1 errors: adding missing properties in MigrateSchemaSqlServerSqlDbTask.json * v1 s360 errors: adding missing properties in MigrateSqlServerSqlDbTask.json and MigrateSqlServerSqlMITask.json * v1 360 errors: adding missing properties in projects.json * v1 s360 errors: adding missing properties in Services.json * v1 s360 error: adding missing properties in Tasks.json * v1 s360 errors: adding missing properties in TasksCommon.json * v1 s360 error: adding missing properties to MigratePostgreSqlAzureDbForPostgreSqlSyncTask.json * v1 s360 errors: adding items to events in "MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError" * v1 s360 errors: removing required property * prettier check * nit Co-authored-by: Vasundhra Manhas Co-authored-by: Thakur Ashutosh Suman * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2021-10-01 (#16900) * Adding The new three properties to the latest API version for RI Transactions * Error Fixes * Fixing Type errors * Changing billingMonth format * Add connectionProperties in GoogleAdWordsLinkedServiceTypeProperties (#17001) * Microsoft.Cdn : 2021-06-01 API (#16868) * Adds base for updating Microsoft.Cdn from version stable/2020-09-01 to version 2021-06-01 * Updates readme * Updates API version in new specs and examples * Update CODEOWNERS file (#1) * update CODEOWNERS file * update CODEOWNERS file * add new cdn code owner Co-authored-by: Jorin Mejia * add forwardingProtocol to OriginGroupOverride (#2) * Cache Behavior and Case Transform (#3) * add forwardingProtocol to OriginGroupOverride * added new cache behavior attributes and case transform enum values * update cache behavior * Swagger changes for enabling certname check and onboarding prevalidated customdomains * Fixing formatting - Swagger changes for enabling certname check and onboarding prevalidated customdomains * Correct input and output types of checkHostNameAvailability API * Set CA and SAN to readonly * Update ValidateSecretInput to include SecretVersion * Nit fix grammar * Swagger changes to move originResponseTimeoutSeconds property from afdendpoint to profile level * Remove redundant fields and mark certificate properties readonly * Reoganize parameters and update descriptions * Update examples * Fix typos and expand abbhreviations * Fix more typo * Update odatatype (#10) * Update odatatype * Update odatatype * Update typeName * camel casing typeName Co-authored-by: Chenglong Liu * Change country to countryOrRegion to avoid political concern according to CELA (#12) * Change country to countryOrRegion to avoid political concern according to CELA * Minor change to keep consistence Co-authored-by: Bo Zhang * Yunhe/cdn 2021 06 01 (#8) * add forwardingProtocol to OriginGroupOverride * added new cache behavior attributes and case transform enum values * update cache behavior * update route and route configuration override rule swagger definition * update * made changes to route and rule to remove EnableCache filed. To disable cache, leave CacheConfiguration to null. * add cache duration to route * update routeConfigOverride action * update route and action * update action swagger * update swagger spec * update examples * update comments * updated examples * server variable (#11) * wip server variable * server-variable udpates * server port transform * socket address * update server variable * resolve comments * revert unwanted change * Revert "server variable (#11)" (#16) This reverts commit d6eddf6a201df30dc2abe23e7083c4c158a8fb83. * [Azure CDN] Add missing customHttpsParameters field in CustomDomainProperties (#15) Co-authored-by: Bo Zhang * Swagger changes for adding secret type AzureFirstpartyManaged certifi… (#13) * Swagger changes for adding secret type AzureFirstpartyManaged certificate * Updating description for AzureFirstPartyManagedCertificate secret type * Updating description for AzureFirstPartyManagedCertificate secret type * resolving merge conflict * resolving merge conflict Co-authored-by: SINADELL * Fix multiple S360 correctness issues related to CDN (#17) * Fix multiple S360 corretness issues related to CDN * Fix privateEndpointStatus location issue Co-authored-by: Bo Zhang * Product Backlog Item 12546459: [AFDX][CDN][RP][SWAGGER] refreshValidationToken API for swagger and RP inconsistency * Product Backlog Item 12546473: [AFDX][CDN][RP][SWAGGER] domainValidationState of AFDDomainProperties swagger and RP inconsistency * Make description more readible * added transform values to all api versions (#19) * Product Backlog Item 12546377: [AFDX][CDN][RP][SWAGGER] Add CustomDomains property definition end EndpointProperties per swagger issue? (#20) * Fixing operations api swagger (#21) Co-authored-by: SINADELL * Change route and security policy to use ActivatedResourceReference for domains associated Routes and security policies can know if their associated domains are validated or not by using ActivatedResourceReference, which contains a property to indicate the domain validation state. * Add ActivatedResourceReference support Adding support to have a resource reference with a property to indicate whether the resource is active. To start with, this would indicate whether a domain referenced is active or inactive, but it can also be used for other purposes in the future. * 2021-06-01 ARM & SDK Fixes (#23) * fix incompatiable names * Revert "fix incompatiable names" This reverts commit 9a2bf2d0512338fdf7bc97bbaf2a4fcdd5a2ade5. * change CacheConfiguration naming to AfdCacheConfiguration * AfdCacheConfiguration -> AfdRouteCacheConfiguration, fix type for SDK issue * add format field to integer types * Add format field to integer types * IsCompressionEnabled -> isCompressionEnabled * responseBasedAFDOriginErrorDetectionSettings -> responseBasedAfdOriginErrorDetectionSettings * use camel casing for resource type * Add default response to delete operation * Update x-ms-name MatchVariable -> WafMatchVariable * Update Error Response to conform to spec * Update Error Response with additional fields * Update reference to error field in ErrorResponse * Fix semantics, validations, typos * Use camel casing and add 200 response code * Add remaining 200 response for delete and conform to operation spec * Add parent resource name in child resource Co-authored-by: Jorin Mejia * Fix merge conflicts (#24) Co-authored-by: Jorin Mejia * fix bug (#25) * Update codeowners, add read only field, add profileName to SecurityPolicyProperties * Merge Main Branch from Azure REST Specs (#26) * [PowerBIDedicated] Elaborate description and examples on capacity mode (#16131) * Elaborate description and exampleson capacity mode * PR fixes * Revert changes for 2017 version * update api scenario documentation (#16086) * add operation step * fix schema * restore OpTest * add cleanUpSteps & remove type * use draft-07 schema * refine propertyNames * add description * remove merge * fix copy/move * use property name * variable type * restore plain style * define Example and file reference in v1.1 * remove raw Example support * fix * rename to API scenario * restore entry * fix ref * swagger ase 2021 06 01 stable preview release (#16120) * Initial commit for 2021-06-01 and 2021-06-01-preview Initial commit for 2021-06-01 and 2021-06-01-preview * new version update * review comments changes. review comments changes. * [Quantum] Add job cost estimate (#16339) * copy existin api-version * update api-version ref * new feature * Revert "[Quantum] Add job cost estimate (#16339)" (#16340) This reverts commit 4df4b843dd2692aadd416dd9ede5979610c08be6. * Update description for ENUM_MISMATCH error code. (#16351) * [EdgeOrder] Update 2020-12-01-preview swagger with swagger correctness fix and other changes (#15962) * new api changes (#1) * new api changes * referer url change * EdgeOrder 2020-12-01-preview Swagger changes (#5) * readme changes * Swagger refresh and update examples * Change examples as per oav validations * Minor swagger modifications * Minor spacing adjustments * Set ModelAsString to true for enums and modify examples * Fix swagger lint validation error * Modify readme and examples * Modify readme.go.md * Update swagger * Minor prettier fix * Change python package version in readme * Fix spell check error * chanegs to enable forward and reverse shipping details in get order item call using odata filter * Swagger correctness fix with other changes (#25) * Swagger correctness fix with other changes * Return api field additions * Change expand description for listOrderItem calls Co-authored-by: Vaishnavi Janardhan * Fix semantic validation error in doubleEncryptionStatus (#30) * Mark parameters of shipping details as readonly (#35) * Additional properties swagger correctness fix (#43) Co-authored-by: sashanm <54701252+sashanm@users.noreply.github.com> Co-authored-by: t-vjanardhan <77781522+t-vjanardhan@users.noreply.github.com> Co-authored-by: Nidhi Jain Co-authored-by: nija-dev <67132984+nija-dev@users.noreply.github.com> Co-authored-by: Vaishnavi Janardhan * Update readme.md (#16349) * [Hub Generated] Review request for VideoAnalyzer.Edge to add version preview/1.1.0 (#16182) * Adds base for updating VideoAnalyzer.Edge from version preview/1.0.0 to version 1.1.0 * Updates readme * Updates API version in new specs and examples * Update AVA Edge Swagger to 1.1 release * fix a linter issue. * fix spelling mistakes * update the api version * update swagger with new changes * fix a bug in one of the ava properties. (#16365) * Swagger for Form Recognizer 2021-09-30-preview. (#16234) * Swagger for Form Recognizer 2021-09-30-preview. * Fix styling issues. * Fix styling. * Remove yml version. * Update Speaker Verification URL (#16348) * Update Speaker Identification URL (#16347) * Creator v1 Deprecated - Delete Swagger Docs (#16225) * Creator v1 Deprecated - Delete Swagger Docs Creator v1 Deprecated as of Sept 6 2021 - Delete Swagger Docs * Creator v1 Deprecated - Delete Swagger Docs Creator v1 Deprecated as of Sept 6 2021 - Delete Swagger Docs * [Hub Generated] Review request for Microsoft.ContainerInstance to add version stable/2021-09-01 (#16247) * Adds base for updating Microsoft.ContainerInstance from version stable/2021-07-01 to version 2021-09-01 * Updates readme * Updates API version in new specs and examples * Adding zones property to resource * Add zones property to relavent examples * Running prettier on modified examples * Adding x-ms-secret to password in responses * Changing parameters to use common types * Reverting changes since they introduced validation errors * Prettier check * Add managedIdentityResourceId to EventHubConnectionProperties (#16358) Co-authored-by: Amit Elran * Adding error responses (#16360) * [KubernetesConfiguration] Release 2021-11-01-preview with FluxConfigurations (#15999) * Adds base for updating Microsoft.KubernetesConfiguration from version stable/2021-03-01 to version 2021-10-01-preview * Updates readme * Updates API version in new specs and examples * Reference common definitions * Add fluxConfiguration to initial commit * Update readmes to new version * Add 409 conflict to scc * Update example api-versions * Add path example * Run prettier * Update dependsOn object body * Update readmes with 2021-09-01 * Change to lastSourceSyncedCommitID * Change to 2021-11-01-previe * [ACR] [New Api Version] add 2021-08-01-preview (#15990) * Initial commit for comparison with previous release * Add new swagger 2021-08-01-preview and examples * Swagger changes for Dataflow flowlets (#16251) * Swagger changes for Dataflow flowlets * Fix reference errors * Fix Lint checks * Separate changes for ADF and Synapse * Address Review Comment * Swagger changes for Synapse flowlets (#16335) * Swagger changes for Synapse flowlets * Add Flowlet to custom words * Address comments * Remove value attribute from certificate object (#15684) * Remove value attribute from certificate object * Fix prettier errors * Adding required property to some of the parameters we initially missed. (#16311) * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Adding required property to some of the parameters we initially missed. * Added new service versions for storage (#16298) * Added new service versions for storage * working on readmes * update * [Microsoft.HybridConnectivity] Promote 2021-07-08-privatepreview to 2021-10-06-preview (PublicPreview) (#16301) * Copy from 2021-07-08-privatepreview api from private repo * Promote 2021-07-08-privatepreview to 2021-10-06-preview * add expiresin custom word for linter fix * fix sdk generation failures * Add batch tag 10/14 (#16393) * add batch tag 10/14 * fix * revert the default tag change (#16398) * [Azure Maps] Timezone: Swagger improvement for SDK generation [Hub Generated] (#16057) * Rename with `x-ms-client-name` * Add extensible enum for timezone accept language * Rename operationId to have better method meaning Add x-ms-client-name for better explaining * Updated description for HasZone1970Location property * Removed Enum in model class name * Better naming for TimeTransitions * Updated x-ms-examples to be more friendly * Update Descriptions * Update method name * Update coordinates with collectionFormat csv * Modified sunrise, sunset type * Update wording for hasZone1970Location description * Use LatLongPair as reference * Modify exists definitions 1. Combined definitions with same structures into TimezoneResult, TimezoneId, ReferenceTime. * Update Examples to fix Model Validation * Rename to Timezone to be consistent * Update description for hasZone1970Location * Minor updates for name, type * Modified property to uppercase to match exmaples * Changed back to using RepresentativePoint Co-authored-by: Alex Tsao * Update to remove default value for enum RouteType (#16343) * [Synapse] - Add x-nullable:true for folder property (#16237) Co-authored-by: Dongwei Wang * Update readme.python.md (#16400) * Dev containerservice microsoft.container service 2021 09 01 (#16215) * Adds base for updating Microsoft.ContainerService from version stable/2021-08-01 to version 2021-09-01 * Updates readme * Updates API version in new specs and examples * Add gmsaProfile in WindowsProfile for AKS (#15976) * Add gmsaProfile in WindowsProfile for AKS * fix spell errors * Fix lint issue * Update readme.md for AKS 2021-09-01 * Expose a few more snapshot properties in 2021-09-01 swagger to match 2021-09-01 API (#16082) * Expose a few more snapshot properties in 2021-09-01 swagger to match 2021-09-01 RP API * Expose a few more snapshot properties in 2021-09-01 swagger to match 2021-09-01 RP API Co-authored-by: Charlie Li * Agent pool start/stop (#16105) * added examples for agentpool start/stop * fixed code styling * added 201 response code in examples * added 201 response code object * added missing parameter * updated description for power state and added title * added power state to request body properties * Update specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/managedClusters.json Co-authored-by: Matthew Christopher Co-authored-by: Matthew Christopher Co-authored-by: Charlie Li <39974812+chengliangli0918@users.noreply.github.com> Co-authored-by: Charlie Li Co-authored-by: rsamigullin <89222124+rsamigullin@users.noreply.github.com> Co-authored-by: Matthew Christopher * PR to make swagger changes for new event grid public SDK release (#16309) * create baseline commit * Add all the changes for new public SDK release * fix the version * fixing prettier check issues * address pr comments * fix arm version in readme * Add extra line * fix lintdiff issue * Adding suppression and fixing sdk readme * fix issues with go sdk path * fix a missing required and a description (#16421) * EventHub : New API version 2021-11-01 (#16363) * base commit for new api version 2021-11-01 * new api version 2021-11-01 changes * CI fixes * CI fixes * fix for Python SDK * added common def v2 * avocado fix * updated common types * update to address S360 * S360 fix for DisasterRecoveryConfigs * Revert "S360 fix for DisasterRecoveryConfigs" This reverts commit 2476975abd304ee89f1382ceaee280ad3a711e15. * Added SchemaRegistry API * CI fixes - Schemagroup * corrected Schemagroup group properties * reverted the proxyresource location change * Revert "reverted the proxyresource location change" This reverts commit ac79e8a163198742f32adfdc40cc11aa2e039e90. * addresing S360 swagger correctness fro operations and capture * updated description for datalake in capture * subscription format to uuid Co-authored-by: Damodar Avadhani Co-authored-by: v-ajnava * databricks: updating the Tags to be consistent (#16422) The other resources within this Swagger use the applicable Resource name however the Private Link resources use GET, DELETE and PUT - this fixes that so that these are consistent. * Fix Swagger correctness bugs. (#16280) * Created new API version for Monitor Action Groups (#16107) * Updated error response for Action Groups API * spacing * added missing fields to Action Group Resource spec * Added missing fields for action group resource in older version * Updated "resource" name * Removed changes to errorResponse * Removed errorObject * format * Updated required and default fields in Action groups spec * Update default value to boolean Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * changes default value type to boolean * undo webhook receiver changes * Created new API version for action groups * Added event hub Receiver to Action groups spec * Updated readme.md for Monitor * Initial checkin for Post and Get test notification apis * Change to completed * Fix some errors * Fix a couple more issues * add x-ms-long-running-operation-options * Context fix * Context * Context * Context * revert unwanted changes since we don't own these * update API version in actionGroups json * update API version in action groups examples * Fix for Swagger PrettierCheck failures * Fix the description of the RG name para * Remove the dupe resourcegroupname para * Another attempt to fix the description * PR comments * fix json format * Fix json * Lets revert the resource descrilption * Fix autorest exception and suppress Lint failures for error response schema * Fix for prettier check * Add providers * Used common types for definitions and parameters * fix lint errors for incompatible parameters * Revert Resource definition update to resolve Lint errors * Revert package tag to fix build break * Update API reference in latest package * PR comment * fix build break because didn't remove the createdBy from the sample * PR comments * Fix typo * Validation errors * Fix errors * Fix errors * Fix style * Change api name * Fix errors * Change the uri * Change the api name Co-authored-by: Ritwik Rajendra Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> Co-authored-by: Thomas Pham * Removed OnvifDeviceGetRequestBody and OnVifDeviceDiscoverRequestBody (#16371) * Removed OnvifDeviceGetRequestBody and OnVifDeviceDiscoverRequestBody * adding required to discoverduration * removing assetsink * making discoveryDuration optional * Add x-ms-pageable to AccessControl List operations (#16416) * Add x-ms-pageable to AccessControl list operations * remove x-ms-pageable from roleDefinitions List operations * Adding back category level samples (#16389) * Adding back category level samples Adding back category level samples * Adding reference to newly added sample files Adding reference to newly added sample files * Tries to fix prettier violations * Remove location field for sub/management group level * Tries to fix prettier by converting tab to spaces * Add track2 batch 4 mysql-->cognitiveservices (#16431) * Add track2 batch 4 mysql-->cognitiveservices * resourcehealth-->sqlvirtualmachine * Fix AVA 2021-11-01 example files (#16432) * fix examples * fix prettier checks * Api Management 2021-08-01 Stable API-VERSION (#16353) * Adds base for updating Microsoft.ApiManagement from version preview/2021-04-01-preview to version 2021-08-01 * Updates readme * Updates API version in new specs and examples * [Azure Maps] Route: Swagger improvement for SDK generation [Hub Generated] (#16193) * Route: Rename parameter/client names * Route: Rename request body names * Route: Model a few objects as enum * Route: rename magnitudeOfDelay * Route: update startPointIndex/endPointIndex docstrings * Route: departureTime/arrivalTime to date-time * Route: Fix name in typescript.md * Route: modify docstrings for firstInstructionIndex/lastInstructionIndex * Route: rename turnAngleInDecimalDegrees * Route: Add docstrings for RouteSection/RouteLeg * Route: rename report object * Route: add friendly x-ms-examples key name * Route: rearrange definitions for better review * Route: remove language reference in hyperlink * Route: Remove repeated descriptions of batch API * Changed model name RouteDirectionsSummary to RouteSummary * Rename to RouteRangeResponse * Add max/min values for efficiency * Name changing with x-ms-client-name * Minor update * Route: naming fix * renamed all kWh to KwH * Route: add default values * Route: Fix wrong name * Route: Change response type name * Updated name and descriptions for route attributes * Remote language in URL * Route: definition name changed for type name * Route: keep the operations for maintaining SDK consistencies * Route: Change response object names * Route: Fix parameter type * Common: Add more definitions for better client type name * Common: Add description for query parameter * Route: Just rename RouteSummary Definition * Common: Redo the naming for batchItems * Route: add names for x-ms-enum * Route: change all floats to doubles (verified in backend) * Route: use collectionFormat for route range api * Route: rename operationIds to remove Post wording * Modified two method names * Route: update vehicleCommericial's client name * Route: update description/client name for carTrain Co-authored-by: Alex Tsao Co-authored-by: Daniel Rocha * [Azure Maps] Weather: Swagger improvement for SDK generation [Hub Generated] (#16148) * Modified AirQuality * Modified AirDetails * renaming variables for Current Condition * 1. Rename to model to WeatherValue 2. Renamed to IconCode definition * Rename properties to description(s) for consistency * Rename model to weatherValueRange * Renamed to Forecast for better self explaining * Better naming/self explaining for values * Update name fpr dbz * Add enum for UnitType, PrecipitationType, IconCode * Updated example files * Fix CI errors 1. Add new word to avoid error checks failing 2. Updated with "x-ms-client-name" to fix CI errors * Update according to review feedbacks 1. Removed duplicate enum attributes 2. Updated descriptions * Update IconCode * Update x-ms-exmaple for better description * Update Enum * add name for enum * Update according to feedback 1. Update all `query` to collectionFormat 2. Set `readOnly=true` for all response 3. Create PastHoursTemperature model for opimization * Update name Co-authored-by: Alex Tsao * [Hub Generated] Review request for Microsoft.Marketplace to add version stable/2021-10-01 (This is internal data plane service inside Microsoft.Marketplace RP) (#16306) * New Swagger Spec File * New Swagger Example Spec File * New Readme Config File * first commit * fix * fix * examples * fix * words * fix * spell * pretty * fix * pretty * fix * comments * spelling * Fix check access response (#16428) * fix check access response * Add DefinitionsPropertiesNamesCamelCase suppression role Co-authored-by: Prince Gupta * Move QuestionAnswering 2021-07-15-preview to main (#16411) * move questionAnswering 2021-07-15-preview to main * update version in examples * [Hub Generated] Review request for Microsoft.KeyVault to add version preview/2021-06-01-preview (#16399) * Bypass incompatible responses * Add missing path * Add version info * Removing undesired 404 * add "x-ms-secret": true to secret field (#16436) * add "x-ms-secret": true to secret field * remove breaking change prop * Update example Co-authored-by: Nan Jiang * Add missing Opt-in APIs S360 (#16362) * add missing APIs S360 * fix json validation error * revert casing change * fix validation errors * run prettier * [Hub Generated] Review request for Microsoft.AppPlatform to add version preview/2021-09-01-preview (#16149) * Adds base for updating Microsoft.AppPlatform from version preview/2021-06-01-preview to version 2021-09-01-preview * Updates readme * Updates API version in new specs and examples * Add new changes for 2021-09-01-preview * Fix some validation errors * Use collection for loadedCertificates * Fix typo * Update readme for new api version autorest generating * name update * name update again * name update again again * rename storageProperties to properties * add systemData * fix * fix lint * resolve comments * fix reference link * fix * add x-ms-secret and x-ms-mutability annotations to accountKey * fix lint Co-authored-by: Wenhao Zhang Co-authored-by: Xuyang Cao * Update readme.python.md (#16451) * Update readme.python.md * config readme * [Hub Generated] Review request for Microsoft.BotService to add version preview/2021-05-01-preview (#16012) * fix some error * update * update * update example * [Azure CDN] Add missing customHttpsParameters field in CustomDomainProperties for versions after 2019-06-15 (#16129) Co-authored-by: Bo Zhang * First time adding VideoIndexer to public repo (#16439) * First time adding VideoIndexer to public repo * Fix spelling * Fix more spelling * remove preview only api for now * [Hub Generated] Review request for Microsoft.TimeSeriesInsights to add version preview/2021-03-31-preview (#16415) * Fix S360 errors in 2021-03-31-preview * Fix prettier check * [network] `2021-02-01-preview-only` tag configuration for Python (#16375) * test * test * Update readme.python.md * Update readme.python.md * Update readme.md * fix * Update readme.python.md Co-authored-by: 00Kai0 Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * Add Change Analysis API version from private repo (#16160) * Add API versions from private repo * Fix prettier and avocado validation report * Fix prettier and avocado validation report * push manifest from private repo * Make changes for public repo * Update to correct api-version' * update agent vm image in pipeline yml (#16467) * Adding Microsoft.Chaos API Version 2021-09-15-preview. (#16453) * [baseline] Microsoft.Chaos private preview API Version 2021-09-15-preview. * msft.chaos PublicPreview API 2021-09-15-preview * Add neccessary readme's from swagger tool branch generation. * remove artifiact resource from public preview. * fix static linter issues. * [Hub Generated] Review request for Microsoft.Security to add version preview/2021-07-01-preview (#16455) * . * . * readme.python config (#16471) * Add text analytics v3.2-preview.2 API (#15736) * Add text analytics v3.2-preview.2 API * CR comments * Make project and deployment names required parameters * Fix projectName and deploymentName Rename projectName and deploymentName in input to project-name and deployment-name Co-authored-by: Omar Elhariry Co-authored-by: Kareem Yousef * Mhsm doc changes (#16444) * backuprestore 7.3 preview changes * remove Go track 1 auto-generation * 7.2 stable description * lint swagger errors Co-authored-by: Joel Hendrix * [Hub Generated] Render v1/v2 reconciliation (#16263) * render v1.0 centric updates multiple zooms differentiated by description removed * revert composition of GetCopyrightResult to resolve weird validation issue * add available tilesets into tilesetId enum * address render review * update the input files * seperate 1.0 tag * rename examples so the names don't clash and OpenAPI doc gen don't freak out, correct missing api in v2.1, remove /map/imagery in v2.1 as it should not be there * see if setting unique operationIds resolves this fragile doc gen * update custom-words for spell-check to pass * improve sample names * correct sample reference * remove V21 from operation ids Co-authored-by: Taras Vozniuk * [Microsoft.DeviceUpdate] Added private Network RP API for Private Endpoint support (#16396) * Added internal Network RP model and API * Fixed semantic validation error * prettier run * Added list operation for NRP-only proxy type * Linter fixes * Removed properties requirement * Removed read-only flags * Removing required from resources * More required properties * More c&p error fixes * Added missing property definition for remote proxy * Wrong place for provisioning state * Rogue space * Fixed an example * Another rogue space * Added internal note to descriptions * Adding missing identity properties and ExtensionTopics operation (#16469) * Adding missing identity properties and ExtensionTopics operation * fixing prettier check issues * Add identity to topic * Add system data to Extension topic response * fix lintdiff issue * fix kusto pool operation id (#16477) * Update Microsoft.Chaos API Version 2021-09-15-preview types/experiment.json (#16480) * Update azure-pipelines.yml to use ubuntu-20.04 (#16485) * Update azure-pipelines.yml * Update ShouldSendPRToMain.yml * Update BranchProtectionForPrivateRepo.yml * Update Chaos Client Name + Update outdated examples. (#16501) * publish Microsoft.AVS 2021-12-01 API (#16426) * copy 2021-06-01 API * replace "2021-06-01" with "2021-12-01" * add 2021-12-01 changes * update readme * add go * add java * fix go * Network may release: monthly branch release from Azure Networking side. (#16395) * Adds base for updating Microsoft.Network from version stable/2021-03-01 to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * Add routing intent resource to 05-01 (#15998) * add routing intent resource to 05-01 * prettier fix * fix api version in examples * Update Exclusion Match Variable enum to support new values (#16124) * Adding new SKU values (#16112) * Adding new SKU values * Fixing basic in Tier(not name) Co-authored-by: Ishani Gupta * Update WAF Policy Exclusions to include RuleSet/RuleGroup/Rule hierarchy (#16154) * VNet Encryption: Add nic flag, vnet property, vnet peering property (#16224) * vnet encryption change * change api version * fix prettier check * add type object for encryption * remove circle (#16307) Co-authored-by: Weiheng Li * move to new branch (#16194) * Missed property added to LoadBalancerBackendAddress and new API (#16334) * Updated load balancer swagger with missing backendAddress property and queryInboundNatRulePortMapping API * Fixed example for QueryInboundNatRulePortMapping API * Fixed warnings * Revert "Fixed warnings" This reverts commit e3e4cac4b19f47452a2b24abfdf9e1e09d041fca. * Revert "Fixed example for QueryInboundNatRulePortMapping API" This reverts commit 5823b77f681534fbda8010901496886c88b81343. * Revert "Updated load balancer swagger with missing backendAddress property and queryInboundNatRulePortMapping API" This reverts commit e3f5bb3ca403ed5045b11bcde59d7b54975ae117. * Put changes into correct API version * Fixed lint diff errors * Fixes based on CR * Fixes based on CR * Fixed warnings * Fixed example * prettier * Fixed spelling * initial PR to the new release branch (#15842) * initial PR to the new release branch * moved body to end of request parameters, changed api version number in examples * Added action name for the list idps filter values * changed to match camel casing for the action added * fixed CR issues * fixing auto checks * fixed ARM cr issues * fixing the resource type to match specification * Isgu/fix/new branch SKU (#16410) * changes in 05 branch * Revert "Adding new SKU values (#16112)" This reverts commit bdf897a9ee38f612e97e84c2090447de0e3b1c79. Co-authored-by: Ishani Gupta Co-authored-by: Ritvika Reddy Nagula Co-authored-by: tejasshah7 <49326906+tejasshah7@users.noreply.github.com> Co-authored-by: Ishani Gupta Co-authored-by: Ishani Gupta Co-authored-by: dtuCloud Co-authored-by: Weiheng Li Co-authored-by: Weiheng Li Co-authored-by: Henry Chen Co-authored-by: irrogozh Co-authored-by: amosarbiv-work <76393841+amosarbiv-work@users.noreply.github.com> * Fixed proxy paths (#16496) * For Add cases, 404 should be error response (#16488) For AddConnectionToGroup and AddUserToGorup, if connection does not exist, or user does not exist, 404 should be considered as error response. * replace resource with proxyresource (#16325) Co-authored-by: Alex Goldschmidt * Add Microsoft.ResourceConnector [Appliance] 2021-10-31-preview API (#16384) * Add Microsoft.ResourceConnector [Appliance] 2021-10-31-preview API * Run prettier on violation files * Add SCVMM to custom-words.txt * Fix validation issues * Fix prettier issue with AppliancesListClusterUserCredential.json * Add multi API section for go readme and update namespace for python readme * Update Example files to be more accurate * Add None to Managed Identity typ in parity with other Azure Arc Resources * Add default value as AKSEdge for distro * Adding type object for ApplianceListResult * Update Identity to use SystemAssignedServiceIdentity from common-types v3 managedidentity.json * Reverting to using custom Identity * Update readme.md * Update readme.python.md Co-authored-by: Anirban Thakur Co-authored-by: Yiming Lei <59104634+RAY-316@users.noreply.github.com> * Josefree doc update (#16457) * Create Sample Directory Structure for Swagger * Delete Sample Directory Structure for Swagger * Create Sample Directory Structure for Swagger * Update Getting started with OpenAPI specifications.md * Delete Sample Directory Structure for Swagger will reuse this wiki https://github.com/Azure/azure-rest-api-specs/wiki#directory-structure, instead of creating a new one. * Update Getting started with OpenAPI specifications.md reuse this wiki for sample directory https://github.com/Azure/azure-rest-api-specs/wiki#directory-structure * Add MDE Onboarding API to Microsoft.Security (2021-10-01-preview) (#16433) * Rename 'whitelist' * add missing 'Group' in renamed file * add mdeOnboarding API - 2021-10-01-preview * fix json format * fix PR issues * add List operation * change to plural, set default resource type name * mismatch between GET and LIST examples * made descriptions clearer, removed unused parameter * defined explicit parameters * delete unused schema Co-authored-by: Erel Hansav * [Hub Generated] Review request for Microsoft.Insights to add version stable/2021-10-14 (#16417) * Adds base for updating Microsoft.Insights from version preview/2020-06-02-preview to version 2021-10-14 * Updates readme * Updates API version in new specs and examples * Fixing a relative path * Pascal casing for the resource provider name * Attempt at fixing R4018 * ADLA RP October Swagger KPI fixes (#16459) * swagger fix * 2016 patch Co-authored-by: Jimmy Xie * Remove readonly on segment length property (#16513) * remove preview tag (#16441) * Disable replay attack checkfor VPN gateway (#16515) * [Hub Generated] Review request for Microsoft.AppPlatform to add version preview/2021-09-01-preview (#16468) * Add dump API * add new line at the end of line * change cases * typo * response * add api for start/stop azure spring cloud instance * fix lint error Co-authored-by: Yinglue Zhang Co-authored-by: caiqing Co-authored-by: YinglueZhang-MS <78456380+YinglueZhang-MS@users.noreply.github.com> * Kusto: Swagger readonly cosmetics changes (no breaking changes) (#16405) * Kusto: Swagger readonly cosmetics changes * supress * prettier * fix 2017-09-07-privatepreview examples * fix 2018-09-07-preview model * 1 * 1 * [Microsoft.Security/Automations] Add AssessmentsSnapshot & SubAssessmentSnapshot data types (#16489) * Add SubAssessment event source type and add more automations examples * Change Location isReadOnlu to false * Test * Add new read/write location and add new type TrackedResourceLocation * Minor * minor * prettier fixes * Change variable name to TrackedResourceLocation * Change type name TrackedResourceLocation to AzureTrackedResourceLocation * Update automations example * Add SecureScores & SecureScoreControls as new supported datatypes in Automations resource * [ASC.Automations] add new data type RegulatoryComplianceAssessment * Add Secure Scores and Regulatory Compliance snapshot data types * Changes * minor fix * syntax fixes * [Microsoft.Security/Automations] Add AssessmentsSnapshot & SubAssessmentSnapshot data types * minor * minor * minor * minor * [Hub Generated] Public private branch 'dev-security-Microsoft.Security-2021-07-01' (#16435) * Adds base for updating Microsoft.Security from version preview/2021-05-01-preview to version 2021-07-01 * Updates readme * Updates API version in new specs and examples * Adding securityConnectors private API * Update the readme.md * adding custom word * Update Security Connector model in examples * Update main security connectors model with new organizational data properties, update examples as well. * added new offerings * fix pathing * fix offering name in all examples * add docs for patch endpoint * add system data resource * Remove duplication * Resolve tools issues * Change bool to boolean * Fix model validation errors * Fix lint error * CR fixes. Move systemData to root of object. Export identity type to definition * remove extra bracket * fix bracketing and pathing * lint fixes * fix camel case for linting * Fix systemData examples Co-authored-by: Sapir Elmakayes <32778998+SapirElmakayes@users.noreply.github.com> Co-authored-by: Sapir Elmakayes * Azure Maps - [Hub Generated] Review request for Traffic to add version preview/1.0 (#16128) * Modified method GetTrafficFlowSegment to remove the Result type and return the data type directly * Revert "Modified method GetTrafficFlowSegment to remove the Result type and return the data type directly" This reverts commit 46bc557383238dad2cd4b5d0a0040fdc754fdb79. * Flattening and renaming of several components within Traffic Segment Flow * Flattened the client for Traffic Incident Detail * More changes in flattening, now for TrafficIncident and Detail * More changes in flattening, now for TrafficIncident and Detail * More feedback addressed * prettier fixes * Clarified doc string * Added start and end time for Traffic incident * Added friendly names for x-ms-examples * Fixed avocado bugs, added query parameter as number array * Added collectionFormat to all comma separated parameters * Small changes to improve codegen * Prettier fixes * Fixed all comments from latest PR review Co-authored-by: Daniel Rocha * Adding Swagger for Short Code API (#15312) * saving progress * fixing typos * fixing typos * fixing typo * running prettier * small comment change * minor fixes * minor fix * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * saving progress * moving shortcodes files to its own folder * saving progress * adding basic readme file * Changing message details to support adding examples for contenttypes, adding estimatedRampUpTime and directionality * adding format for urls, emails and phone numbers * renames on different fields * adding back helpMessage and optOutMessage * removing tel format * S360: fix missing accesslevel field in requestResponse (#16464) * fix missing accesslevel field in requestResponse * fix another s360 issue * fix fields in example files as well * update custom words * [Hub Generated] Review request for Microsoft.DocumentDB to add version stable/2021-10-15 (#15733) * Adds base for updating Microsoft.DocumentDB from version stable/2021-06-15 to version 2021-09-15 * Updates readme * Updates API version in new specs and examples * Add support for fetching continuous backup information for latest restorable timestamp. * Adding locations API and backupRedundancy * Fixing ref * Add 10-15 Preview along with ClientEncryptionKey management changes * Renaming 2021-09-15 api version to 2021-10-15 * Fixing some more renames * fix validation checks * add clientencryptionkeys to custom-words * initial commit * Swagger specifiations * readme file updated * Review comments addressed * Added TotalThroughputLimit property to Database Create and Update * Rebased and added type to capacity * Added changes to preview folder as well * Added changes to missing files * initial checkin of base version * Adding examples; /deallocate and /start api in swagger * update readme.md file * Removing 2021-10-15-preview changes * managed cassandra swagger changes for GA * Fixing linter issues * minor description fixes * adding missing example * add stable and preview swagger * revert to Thu Sep 9 2021 change * fix linter errors in swagger * fix validation errors * validation fixes * remove fetchNodeStatus from stable * remove unused example file, fix validation error * Fixing the spell check and formatting issues * remove /repair api, make /command async * remove unreferrenced example json * remove pageable link from /status api * remove backups api, add cassandraAuditLoggingEnabled property * add cassandraAuditLoggingEnabled property * make /status api async, minor fixes * remove async tag to /status * remove connectivity property, add Ldap as preview * remove unreferenced example files * use guid in subid for examples * add backupStorageCustomerKeyUri property * fix api response code * remove ldap * Changing operationId for locations API * review comments Co-authored-by: REDMOND\amisi Co-authored-by: Anuj Toshniwal Co-authored-by: Abhijit Karanjkar Co-authored-by: Praful Johari Co-authored-by: visunda Co-authored-by: Vivek Sundararajan Co-authored-by: vivek-microsoft <32766101+vivek-microsoft@users.noreply.github.com> * [SignalR] Add stable version 2021-10-01 (#16044) * init * remove * Add 2021-10-01 * Minor update * Add 2021-05-01-preview swagger API support for Autoscale newly added fields and new controller path. (#16463) * Initially cut, cloned from know existing GA bits (IE \specification\monitor\resource-manager\Microsoft.Insights\stable\2015-04-01) * rev API version, add new controller API path, and update JSON showing newly added predictiveAutoscalePolicy field * [QuotaRP] Fix LimitObject polymorphism (#16438) * Fix LimitObject polymorphism * move properties out of allOf * add type to LimitObject * value is required * Updating Operations Tag to QuotaOperations. * Update quota.json Updating Summary field for operations. Co-authored-by: Rahul Singh <53578268+rahuls-microsoft@users.noreply.github.com> * resolving s360 item (#16476) * resloving s360 itme * added prettier-fix changes Co-authored-by: Gaurav Bang * fix typo: readonly to readOnly (#16548) Co-authored-by: Xuyang Cao * [Hub Generated] Review request for Microsoft.Security to add version preview/2021-07-01-preview (#16549) * Adds base for updating Microsoft.Security from version preview/2021-07-01-preview to version 2021-07-02-preview * Updates readme * Updates API version in new specs and examples * Fix account id to account ids * Minor * Minor Co-authored-by: Sapir Elmakayes * [Hub Generated] Review request for Microsoft.Maps/Microsoft.Maps to add version preview/2.0 (#16487) * added extra fields to JSON list data response in docs * added content-type field to request header * took out content type from header field due to errors; JSON reponse fields for user Data are ready to commit * [Hub Generated] Review request for Microsoft.Maps/Microsoft.Maps to add version preview/1.0 (#16446) * Remove mobility * Remove mobility * Remove mobility * Remove mobility reference * Trigger another pipeline? * Remove more mobility * [Hub Generated] Review request for Search to add version preview/1.0 (#16283) * First set of changes for Search API * More changes to address review * More changes to address review * More changes to address review * Reset searchAlongRoute name * Fixed roadUse * Fixed OAV error * Minor fixes * Fixed fuzzy search errors from review * Changes in Reverse Search Address mode * More changes from the review * Checkpoint commit * Fixed floating point numbers, dataSources field * Modified boundingBox to avoid causing model validation failure * Fixed more examples * Fixed more broken examples * Fixed more examples * Fixed more examples * Prettier fixes * Re-add street and buildingNumber * Revert client body flattening, add names for x-ms-enum * Removed locale-specific URLs * More changes to address review * More changes to address review * Minor fixes * More changes from the review * Fixed floating point numbers, dataSources field * Fixed final issues for review * Modified boundingBox to avoid causing model validation failure * Prettier fixes * Revert client body flattening, add names for x-ms-enum * Reflect operationId changes in Readme.typescript * Keep operations in TypeScript to be consistent for all languages * Update sdk generation to track2 * Prettier fix * Revert "Update sdk generation to track2" This reverts commit 5ede489e84a1820c06f7c26f70bf1bc9c2a3ec86. * Remove .net sdk generation since it is not used * Added prefix to Operation Id. * Fixed couple of operationIds * Renamed PolygonResponse * Address PR comments * More changes due to PR Review * Testing new batch naming * Fixed bug in searchInsideGeometry * Testing new batch naming * Fixed batch naming that didn't work well. * Renamed searchInsideGeometryBody to geometry * Finished all PR review comments, added changes to Common and Route Co-authored-by: Daniel Rocha Co-authored-by: alankashiwa * Removed redundant parameters from data plane account update example (#16552) Co-authored-by… * remove the unused parameter (#17233) * remove the unused parameters (#17236) * Fix swagger correctness: secrets were wrongfully marked as write-only (#17228) * allow accessKeys to be readable * add x-ms-identifiers * remove x-ms-identifier * Cdn swagger 2021 06 01 fix (#17278) * Add blockchain to latest profile * Add additional types * [CDN] Fix incorrect type for compressionSettings and SharedPrivateLinkResourceProperties * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Update SecurityPolicy patch operation * Removing originResponseTimeoutSeconds from endpoint level * Fix the afdendpoint example * Fix the cacheDuration format * Adding user assigned identity to managed identity * Fix the typo and example * Fix OBJECT_ADDITIONAL_PROPERTIES * Revert responseBasedAFDOriginErrorDetectionSettings Co-authored-by: Mark Cowlishaw Co-authored-by: Chenglong Liu Co-authored-by: Bo Zhang Co-authored-by: SINADELL Co-authored-by: Sindhuri Co-authored-by: AJ Brown * trafficmanager: adding the missing enum values for traffic manager endpoint (#16472) * trafficmanager: adding the missing enum values for traffic manager endpoint These are required in the API but undocumented - so pulling these out explicitly * trafficmanager: casing to TitleCase * Update readme.python.md (#17357) * [Go] Add track2 config:elastic,resourcemover,policyinsights (#17359) * [Go] Add track2 config:elastic,resourcemover * Add policyinsights * policyinsights add modelerfour.lenient-model-deduplication * [machinelearningservices] track2 config (#17361) * track2 config * track2 config * Add Immutable property for Release Policy, remove Export operation fo… (#17270) * Add Immutable property for Release Policy, remove Export operation for 7.3-preview * Fix grammar in description Co-authored-by: Heath Stewart * [purview catalog] fix guids rest name (#17344) * make client name guids and rest name guid * fix list docstring * update example for list by guids * link examples * revert changes to package lock * fix json in example * switch to rest name for guid param in examples * Compute: Use x-ms-secret for secrets (#17302) * [Go] resources/armsubscriptiions add directive fox fix Duplicate Schema named 'ErrorResponse' (#17362) * [Go] resources/armsubscriptiions add directive fox fix Duplicate Schema named 'ErrorResponse' * appservice stuttering * add x-ms-enum for peering (#17239) * add x-ms-enum for peering * remove the redundant default tags in readme.md * add x-ms-enum (#17230) * Update readme (#17308) Co-authored-by: Bogdan Ostojic * update-applicationinsights-for-typescript.md (#17374) * Logz/metrcis new version (#17268) * adding new api version * updating version and adding new apis * adding apis * swagger fixes * prettier fix * adding api version for operations api * adding api versions param for operatiosn for previous and stable version Co-authored-by: Gaurav Bang * Revert "KeyVault: Add OKP/EdDSA support to version 7.3-preview (#17251)" (#17331) This reverts commit d50e631dc346816c098ab68e368cc5c2434b0d81. * Updated SubscriptionRP v2020-09-01 for s360 (#17318) * Updated SubscriptionRP v2020-09-01 for s360 * Model validation errors are fixed Co-authored-by: Ochi * [AutoSyncApiSpec] 9af119ec9 Merged PR 5582886: fix ut for release s198 (#17401) Co-authored-by: swagger-automation * move iotsecurity apis to private repo (#17321) * Compute 2021-11-01 Release (#17120) * compute folder with pre-population * fix examples folder * fix an example file * update compute to match last version * run prettier fix examples * change capitalization * Compute Swagger changes to include cross-region Restore Points scenarios (#16570) * RRP changes in swagger * Fix conflicts * fix validations * Fix instance view * Revert "Compute Swagger changes to include cross-region Restore Points scenarios (#16570)" (#16663) This reverts commit 70a8729e86b30440cdd3c239272e31dff7f9627b. * sync with last version * add missing examples * suppress bodyTopLevelProperties * Add VMSS filter to List VMs (#16813) * change1 for change file * change description * change description * add suppression for required properties * Revert "Add VMSS filter to List VMs (#16813)" (#16956) This reverts commit 231fd2260cb9e63ba16d8b15d405f3134fe612c1. * Remove impossible state from example (#16544) * Downmerging change from Azure:main (#16654) Co-authored-by: Avinash Akka * Added CVM settings for version 2021-11-01 (#16622) * Added CVM settings * added examples * Add CMK examples * fixed typo * fixed file name * prettier check * removed a br * changed to VMDiskSecurityProfile * type as object * Added vm size properties for vm scale set (#16723) * Added vm size properties * Added get examples * Added example for vm size properties * Added example for vm size properties Co-authored-by: Theodore Chang * Spec for ProtectedSettingsFromKeyVault and AllowExtensionOperations (#16590) * KV changes * adding allowExtensionOperation * fixing examples * Add repairAction to auto repairs feature and update grace period to PT10M (#16535) * Add timeCreated to properties for VM, VMSS, CR, DH resources (#16539) * add creationTime to properties for VM, VMSS, CR, DH resources + remove required location for Resources * rename creationTime to timeCreated * examples for timeCreated * add minimum api-version to descriptions for timeCreated * add GetVirtualMachineScaleSet example * reformat example Co-authored-by: Chase Van Buskirk * DedicatedHost Reboot Feature (#16737) * added new feature to compute.json * added example for my feature * prettier check on the reboot example * fixed names of parameters in example file: * changed name to DedicatedHosts_reboot and moved change to where the other DH APIs are * added cloud error to the reboot * fixed default error, it was in the wrong spot * moved reboot to end of specs * moved older swagger files to 2021-11-01 * reverted previous commit * renamed reboot to restart as per sameers comment * updated description as per sameers comment * updated api version to 2021-11-01 per sameers comment * Adding the new paramaters zone/placementGroupId to forceRecoveryServiceFabricPlatformUpdateDomainWalk VMSS API (#17041) * save (#17091) Co-authored-by: Theodore Chang * Update compute.json (#16482) When a customer tries to scale VMSS using Terraform, since the current definitions do not have publicIpPrefix property, the new VM will be assigned a random IP address which is outside the range of public Ip prefix. Customer has to resolve the issue by deleting the Vmss and recreating it. This PR tries to resolve the issue by adding the publicIpPrefix property in the JSON definition which is used to generate a request for VMSS update. More details about the issue can be found here - https://github.com/Azure/azure-rest-api-specs/issues/10190 * add vmss filter to list (#16957) * change1 for change file * change description * change description Co-authored-by: LexieXie * move Kashif's change to 2021-11-01 * Revert "Spec for ProtectedSettingsFromKeyVault and AllowExtensionOperations (#16590)" (#17121) This reverts commit 220cfd0638942c04275d69fd485ceb2da02a96d3. * fix CI failures, and run prettier on added examples * for credscan. change password example * Update readme.python.md * Compute Swagger changes to include cross-region Restore Points scenarios (#16682) * RRP changes in swagger * Fix conflicts * fix validations * Fix instance view * change instance view * Fix example * Fix prettier * Fix and modify description * Review comments * make new api call long-running-operation * compute folder with pre-population * fix examples folder * fix an example file * update compute to match last version * run prettier fix examples * change capitalization * Compute Swagger changes to include cross-region Restore Points scenarios (#16570) * RRP changes in swagger * Fix conflicts * fix validations * Fix instance view * Revert "Compute Swagger changes to include cross-region Restore Points scenarios (#16570)" (#16663) This reverts commit 70a8729e86b30440cdd3c239272e31dff7f9627b. * sync with last version * add missing examples * Add VMSS filter to List VMs (#16813) * change1 for change file * change description * change description * Revert "Add VMSS filter to List VMs (#16813)" (#16956) This reverts commit 231fd2260cb9e63ba16d8b15d405f3134fe612c1. * Remove impossible state from example (#16544) * Added CVM settings for version 2021-11-01 (#16622) * Added CVM settings * added examples * Add CMK examples * fixed typo * fixed file name * prettier check * removed a br * changed to VMDiskSecurityProfile * type as object * Added vm size properties for vm scale set (#16723) * Added vm size properties * Added get examples * Added example for vm size properties * Added example for vm size properties Co-authored-by: Theodore Chang * Spec for ProtectedSettingsFromKeyVault and AllowExtensionOperations (#16590) * KV changes * adding allowExtensionOperation * fixing examples * Add repairAction to auto repairs feature and update grace period to PT10M (#16535) * Add timeCreated to properties for VM, VMSS, CR, DH resources (#16539) * add creationTime to properties for VM, VMSS, CR, DH resources + remove required location for Resources * rename creationTime to timeCreated * examples for timeCreated * add minimum api-version to descriptions for timeCreated * add GetVirtualMachineScaleSet example * reformat example Co-authored-by: Chase Van Buskirk * DedicatedHost Reboot Feature (#16737) * added new feature to compute.json * added example for my feature * prettier check on the reboot example * fixed names of parameters in example file: * changed name to DedicatedHosts_reboot and moved change to where the other DH APIs are * added cloud error to the reboot * fixed default error, it was in the wrong spot * moved reboot to end of specs * moved older swagger files to 2021-11-01 * reverted previous commit * renamed reboot to restart as per sameers comment * updated description as per sameers comment * updated api version to 2021-11-01 per sameers comment * Adding the new paramaters zone/placementGroupId to forceRecoveryServiceFabricPlatformUpdateDomainWalk VMSS API (#17041) * save (#17091) Co-authored-by: Theodore Chang * Update compute.json (#16482) When a customer tries to scale VMSS using Terraform, since the current definitions do not have publicIpPrefix property, the new VM will be assigned a random IP address which is outside the range of public Ip prefix. Customer has to resolve the issue by deleting the Vmss and recreating it. This PR tries to resolve the issue by adding the publicIpPrefix property in the JSON definition which is used to generate a request for VMSS update. More details about the issue can be found here - https://github.com/Azure/azure-rest-api-specs/issues/10190 * add vmss filter to list (#16957) * change1 for change file * change description * change description Co-authored-by: LexieXie * move Kashif's change to 2021-11-01 * fix CI failures, and run prettier on added examples * Revert "Spec for ProtectedSettingsFromKeyVault and AllowExtensionOperations (#16590)" (#17121) This reverts commit 220cfd0638942c04275d69fd485ceb2da02a96d3. * for credscan. change password example * make new api call long-running-operation * Update readme.python.md * Compute Swagger changes to include cross-region Restore Points scenarios (#16682) * RRP changes in swagger * Fix conflicts * fix validations * Fix instance view * change instance view * Fix example * Fix prettier * Fix and modify description * Review comments * update Repair action to enum and update readme * rebase to main since 2021-08-01 merged. update readme * update x-ms-enum name for RepairType * add default response to operations * update * put back 'required' tag for Resource.Location property and use a new object for VM_LIST return object * fix json format * update examples * run prettier on updated examples * update example for credScan * add VirtualMachineResource for toplevel property suppression. * lint diff errors * lint diff fix update * remove change for VMextensions.location bug * return readme file and examples before vm.vmextension.location change Co-authored-by: sukodava <78733210+sukodava@users.noreply.github.com> Co-authored-by: Dapeng Zhang Co-authored-by: xielexie <94083876+xielexie@users.noreply.github.com> Co-authored-by: Mike Richmond Co-authored-by: Avinash Co-authored-by: Avinash Akka Co-authored-by: ms-saypaul <67093296+ms-saypaul@users.noreply.github.com> Co-authored-by: Raktima Das Co-authored-by: kamusta-msft <56413142+kamusta-msft@users.noreply.github.com> Co-authored-by: frank-pang-msft <92764154+frank-pang-msft@users.noreply.github.com> Co-authored-by: Chase VanBuskirk Co-authored-by: Chase Van Buskirk Co-authored-by: vbhasker-msft <93355049+vbhasker-msft@users.noreply.github.com> Co-authored-by: avjai <34567499+avjai@users.noreply.github.com> Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Co-authored-by: karthikka4820 <88366202+karthikka4820@users.noreply.github.com> Co-authored-by: LexieXie Co-authored-by: Yuchao Yan * Add resource type enum in Cdn 2021-06-01 (#17403) * Add blockchain to latest profile * Add additional types * Add ResourceType enum value * Update ResourceType modelAsString Co-authored-by: Mark Cowlishaw Co-authored-by: Chenglong Liu * 2021/11/18 Add AirQuality, Historical, and Tropical API (#16802) * 2021/08/05 Add Tropical api * 2021/11/18 Add air quality api * 2021/11/18 Add Historical api * 2021/11/22 Update enum and add x-ms-client-name * 2021/11/23 Update examples * 2021/11/23 Update naming * 2021/11/23 Create parameter for Position * 2021/11/23 Update active storm * 2021/11/30 Change reponse to result * 2021/11/30 Add x-ms-client-name * 2021/11/30 Update timestamp, coordinate, and radius naming in SDK * 2021/11/30 Use WeatherUnit for Concentration * 2021/11/30 Update Daily Air quality dominantPollutant * 2021/11/30 Unify response format * 2021/11/30 Unify CurrentAirQuality and HourlyAirQualityForecast * 2021/12/01 Update window and weatherValue SDK name * 2021/12/02 Update coordinate and left, right SDK name * 2021/12/03 Add SDK name for results * 2021/12/03 Improve Object name * 2021/12/03 Update ActiveStorm * 2021/12/03 Remove needless object and update name * 2021/12/06 Add weather 2.0 directory * 2021/12/06 Recover Weather 1.0 Swagger file * 2021/12/07 Remove v2 from operationId * 2021/12/08 Update readme.md * Set default API version as 2.0 * 2022/01/07 Remove default value for api-version * 2022/01/07 Remove needless custom-words * 2022/01/11 Update api-version and add nextLink * 2022/01/11 Update api-version in readme.md Co-authored-by: John Lai Co-authored-by: evaou * Azure Quantum: Fix data-plane `readme.md` AutoRest configs & mark optional data model fields as nullable (#17388) * Update data-plane configurations * Update Job Cost Estimate field description * Add basic-setup-py: true * Add generate-metadata: true * Fix Python readme.md settings * Update Typescript config * Remove payload flatenning * Disable client-side validation * Allow job metadata to be null * Allow metadata to be null * Rollback * Mark fields as nullable * Remove C# client-validation parameter Co-authored-by: XField * Updating tag (#17304) * Updating tag * Update readme.go.md * Update readme.go.md * Update readme.java.md * Update readme.go.md * Update readme.python.md * Update readme.python.md adjusting version * [Hub Generated] Review request for Microsoft.Authorization to add version preview/2021-11-16-preview (#17200) * Adds base for updating Microsoft.Authorization from version preview/2021-07-01-preview to version 2021-11-16-preview * Updates readme * Updates API version in new specs and examples * Adding access review history definition models and methods * Semantic validation fixes * Fix linting issues * Uneeded pagable * More linter fixes * More linter issue fixes * Ran prettier * Ran prettier * Lint and model validation fixes * Adding nextlink * Fix broken SDK * Revert "Fix broken SDK" This reverts commit 040d220feab646310f5bf0b2dbfc8f0ef0f40f9d. * Make generating a downloadable uri a post instead of patch * Making generateDownloadUri it's own api * Adding delete history definition by Id * Added post per instance and added body to Put * Fixing validation errors * downloadUri readonly and only returned by POST * Introducing new API version 2021-12-01 for Azure Site Recovery service (#17333) * Initial commit with 2021-11-01 api version * New api-version 2021-12-01 in ASR * Add readme.md changes * Update readmes for SDK Auto-gen (#17328) * Update readme.python.md * Update readme.python.md * Update readme.python.md * Update readme.md * Update readme.java.md * Update readme.go.md * Update readme.md * Remove multiapi * Update readme.md * Update readme.python.md Co-authored-by: Yuchao Yan * Fix the defaultaction and publicnetworkaccess property in 2021-11 version for servicebus (#17389) * Fix the defaultaction and publicnetworkaccess property in 2021-11 version for servicebus * Add publicnetworkaccess to create response * New Azure Virtual Network Manager API Version (#17311) * add base api to new version folder for reviewer reference * add chenges for new api versiongit add . * adding changes for new api version * removing extra files left over from PR fix * fixing xmsIdentifierValidation errors * checks not running, changing text to retrigger * checks not running, changing text to retrigger * adding force delete and recursive delete parameters * add missing x-mx-paramter-location attributes, and fix warnings * adding force delete and recursive delete parameters * adding force delete and recursive delete parameters Co-authored-by: Jared Gorthy * [Go] compute add batch -package-2021-11-01 (#17420) * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-12-01 (#17271) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-10-01 to version 2021-12-01 * Updates readme * Updates API version in new specs and examples * - Adding support for creation of new 'Enhanced' policy for IaaSVM backup - This policy type will additionally support hourly backups along with daily and weekly supported by current policy - Added respective examples for create/update, Get and List policy api * - prettier fixes * updating readme.md to new api * - correcting the path of new example files * - fixing examples * - more fixes in examples * fixing spell check error * fixing semantic errors * - semantic errors fix * Update data-plane autorest configs (#17421) * Adding system data property in examples for api version 2021-08-01 (#17432) * Bringing back the accidentally deleted OneDeploy api spec (#17408) * Fix the defaultaction and publicnetworkaccess property in 2021-11 version (#17387) * Fix the defaultaction and publicnetworkaccess property in 2021-11 version * prettier check * Add publicnetworkaccess to create response * s360 correctness: SubscriptionRP v2019-03-01-preview (#17429) * s360 correctness: SubscriptionRP v2019-03-01-preview * example for renameSubscription is corrected Co-authored-by: Ochi * [Go] Rename stuttering (#17440) * [Go] rename stuttering * fix * [Storage] move CloudError to `common.json` to resolve the duplicate schema issue (#17336) * move cloud error to common.json * remove definition of Clouderror * Preparing a new tag without the conflicting operation "Operations_List" (#17315) * Preparing a new tag without the conflicting operation "Operations_List" * Correcting components_API.json version for the tag * Updating the latest tag, adding reference materials to readme.md * Avocado error fix * added categories to poi in search.json (#17446) * Adding missing properties to the swagger targeting 2021-05-01 (#16747) * Updating 2021-03-01 with extendedLocation and vmss ID * Trying to fix errrs * fixing property name * Adding EL and VMSS ID into 2021-05-01 swagger * Adding fields back * Fixing * Fixing version param Co-authored-by: jmccarthy * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2021-10-01 (#17354) * removing the mutable property * Missing properties Co-authored-by: Mita Garg * ACR new API 2021-12-01 preview (#17410) * Updating readme.python.md (#17449) * Updating readme.python.md * Removing unused definitions * update-typescript.md-for-servicefabricmesh (#17461) * [Azure App Configuration] Add 2021-10-01-preview version (#17444) * Add 2021-10-01 folder * Update readme * Remove wrong folder * Add 2021-10-01-preview folder * Update enum value * config (#17466) * [Maps][Search V2] add query to geocoding api (#17207) * add a new query parameter, query, to geocoding api * update parameter description * refine description * move ClientId to end of parameters for autorest * add a description to note that batch geocoding doesn't support the parameter, query * Changed singular Dimension and Tag to plural (#17455) * config readme and python (#17469) * config readme and python * config python * [Hub Generated] Review request for Microsoft.Cache to add version stable/2022-01-01 (#17437) * Adds base for updating Microsoft.Cache from version stable/2021-08-01 to version 2022-01-01 * Updates readme * Updates API version in new specs and examples * Add 2022-01-01 API version for redisenterprise which includes non-preview support for Active Geo Replication * Add missing example file for 2022-01-01 redisenterprise version * Add missing type properties to 2022-01-01 api version of redisenterprise * Add example for operations list action for redisenterprise * Fix api version in redisenterprise OperationsList example * Remove extra property from OperationsList redisenterprise example * Fix formatting of OperationList.json * Add AzureStack Hub Admin VPN API (#17245) * Add AzSAdmin VPN API * Addressed lint diff R4041 * Address prettier check * Addressed comments, changed ProvisioningState to enum * fix storage swaggers (#17423) * fix storage swaggers * add lro headers * [Hub Generated] Review request for Microsoft.AzureStackHCI to add version stable/2022-01-01 (#17377) * Adds base for updating Microsoft.AzureStackHCI from version stable/2021-09-01 to version 2022-01-01 * Updates readme * Updates API version in new specs and examples * remove readonly attribute * added example file * Format the files * Update readme.python.md (#17482) * [S360 Correctness] Microsoft.Billing Adding missing property in GA swagger (#17458) * Adding totalCount to transactionList result * Adding BilingProfileInfo on agreements to GA version * Adding type object * fix security alert (#17487) Co-authored-by: ruowan * change x-ms-long-running-operation-options to use original-uri (#17454) * Adding changes resource type to Microsoft.Resources (#17500) * Adding changes resource type * Changing date to march * Suppress system data * Minor change * Resolve swagger lintdiff * Swagger lint diff * Swagger lint diff * Minor change * Semantic Validation * Swagger LintDiff * Readme * Readme * Suppression * Updated API Version for Elastic Pools to support readscale (#17519) * Update v5 SDK tag for IPV6 firewall rules API (#17334) * [Go]applicationinsights add batch tag package-2022-01-11 (#17520) * add x-ms-enum to synapse (#17510) * add x-ms-enum to servicefabric (#17508) * add x-ms-enum to servicefabricmanagedcluster (#17509) * Swagger correctness fix : add zonal-configuration property (#17448) Co-authored-by: Priyankar Gupta * Update REST API Example (#17456) * update example * external * 2021-08 as default (#17419) * Addition of new datacenter codes to databox rest-api-specs preview file (#17279) * Added new datacenter codes to databox rest-api-specs preview repo * Removed YQB20 from the new additions * [Search] Specify some renames for Aml skill in the client SDKs (#17541) * Specify some renames for the client SDKs * Fix typo in a description * mgmt, dps, fix java readme (#17529) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2021-10-01 (#17549) * Removed NOT property * Removed NOT description * [Hub Generated] Review request for Microsoft.AlertsManagement to add version preview/2019-03-01-preview (#17366) * add description and actionStatus to alert properties * prettier fix * export fix (#17407) * Update Storage.json (#17564) * Update EventHub.json (#17565) * [Hub Generated] Public private branch 'dev-digitaltwins-Microsoft.DigitalTwins-2021-06-30-preview-merge-with-main' (#17186) * Adds base for updating Microsoft.DigitalTwins from version stable/2020-12-01 to version 2021-06-30-preview * Updates readme * Updates API version in new specs and examples * Add RM API Version Microsoft.DigitalTwins 2021-06-30-preview (#3404) * Add SDK Generation Options for new API Version (#3179) * Add SDK generation for 2021-06-30-preview * The following fixes were done: * Fixed schema location: preview instead of stable * Updated go SDK generation to point to preview namespace * Remove Ruby support * add SystemData and update instance and endpoints definitions * added systemdata to all examples * fix typo * fix prettier issues * added experimental operations fix * fixed some errors * addressed lint and model errors * fixed type issues with endpoints examples * Fixed autorest error * removed unnecessary _allOf_s * Add Time Series Database Connection Resource and CRUD API Endpoints (#3180) * Added basic time series integration resource CRUD and resource description * Add list call for TSDB integration resources * Modify naming for adx endpoint * Rename document names and paths from integration resources to time series database connections; also clean up descriptions, and make more specific to time series database connections (rather than general integrations) * Update operation names * Resolve review comments * Add examples for time series database connection CRUD * Add example for missing status code 200 to DELETE * Run prettier and fix formatting issues * Align tags, solve issue in Python SDK generation * Align python readme * Fix linter error * Fix linter error 2 * Fix linter error * Made privateEndpointConnections readonly, added additional documentation for keybased and entitybased authenticationType (#3358) * Address major lintdiff warnings * Fix more linter warnings * Address remaining lintdiff warnings and errors * Remove property flattening to avoid issues with polymorphism, edit suppression directives to point to new location * Address lintdiff error * Add systemData property to private endpoint connection resource * Address breaking change warnings * Fix inheritance * Update suppressions to point to new locations in document * Updated TSDB connection parameter set * Fix issue in property set * Revert readOnly=true from private endpoint connections property * Revert change to TopicEndpoint * Back to camelcase... * Revert change in old API version * Revert TopicEndpoint back to camelCase * Revert allOf addition * Change capitalization of TopicEndpoint back to original from previous version * Add approved suppression * Fix $.definitions path in suppression rules Co-authored-by: Nate Lehman Co-authored-by: Nate Lehman * Align with repo (#5658) Co-authored-by: Nate Lehman Co-authored-by: Nate Lehman * [Hub Generated] Review request for Microsoft.HybridCompute to add version preview/2021-12-10-preview (#17047) * Adds base for updating Microsoft.HybridCompute from version preview/2021-06-10-preview to version 2021-12-10-preview * Updates readme * Updates API version in new specs and examples * added CloudMetadata to the swagger and updated cli/az config files * added code 200 to examples * fixed Linter issue * ran npm prettier * added patchMode to the API * reverted the accidental change of package-lock.json * addressed code reviews && added justin's agentConfiguration * ran npm prettier * added words to the ./custom-words.txt and fixed a type error in .json * Change readonly to readOnly * changed enum True to true, False to false. Added descriptions for new definitions * moved the agentConfiguration description to the right place * renamed agentConfiguration properties * added type object ot defintions * changed the agentConfiguration properties namings in examples * added operations list example * shortened the example and ran npm prettier * removed lastupdatedby and lastupdatedtimestamp * reverted enum true/false to boolean * removed extra coloumns * fixed examples * fixed examples * Guest Configuration: Fix S360 Swagger spec correctness and Linter errors (#17319) * Add GET all methods for resource group and subscription * Fix Linter Validation issue * Fix Swagger Correctness S360 items * Fix swagger validation comments * Fix model validaiton * Fix Lint errors * Fix model validation for examples * IoT Central Public API 1.1-preview Oct Release (#16514) * Add new 2.0-preview.1 version for IoT Central * fix typo on enum value * rollback 1.0 changes, applied 2.0-preview.1 * fix typo * remove non-used examples * fix style * update version from 2.0-preview.1 to 1.1-preview * update code review comments, fix patch consumes with json-patch support, fix examples for fileupload * add nextLink to collection of orgs * fix typo * fix wrong position of paging * fix the paging * add . to description * update default to use enum for api-version * add oct release with query, cde v2, device filter, device template filter, relationship, edge template, simplified template patching * update examples * fix lint error, model validation * fix missing type in examples, remove url format * fix ID case * fix id case * fix ID case * add iotc query language reference * fix typo * Make ConfigurationSetting read-only property * Fix Swagger S360 issues * Remove the unknown file * Fix prettier check * Changing the vmssResourceId to camelCasing * Revert the readOnly tag on name property Co-authored-by: Aashish Rajaram Salokhe Co-authored-by: Johnson Yang * Swagger correctness fix : add zonal-configuration property (#17447) Co-authored-by: Priyankar Gupta * {EventGrid}: Update data-plane Swagger to include aeg-channel-name in header (#17606) * Update EventGrid data-plane Swagger to include aeg-channel-name in header * Update EventGrid data-plane SDK with aeg-channel-name header requirement * Addressed review comments * Prettier fix * Encoding single quote in description * Fix apostrophe * Remove apos for simplicity Co-authored-by: Laurent Mazuel * Language API for TA (2022-02-01-preview) (#16921) * WIP for language api spec for TA * Updated preview version number; finished up async definitions * Finished first draft of full spec * Finished first draft of full spec, minus FHIR structuring in HC output * Removed features not included in 2021-11-01 preview * Update custom text tasks TODOs * Moved common definitions to TA-specific definitions * Added custom text tasks to JobManifest * Addressing feedback from PR comments and internal review * Addressed some PR comments * Updated some remaining references to documents * PR comments * Updated a previous change * Reverted references to 'records' back to 'documents' * A few small updates to examples; removed base Task type to simplify structure * PR comments * Addressed TODO items; removed LD-related objects (will be added in another preview) * Fixed anonymous types * Removed required field for body in POST request * Fix prettier check * Added a few more details; experimental change for documents property * Ran prettier * Correction to AnalysisInput object * Merged changes from 2021-11-01-preview and moved new changes to 2022-02-01 * PR comments * Updates to the design for tasks * Added custom entities task to examples * Updates * Finished implementation of discriminator pattern and added some exmaples * Updates * Prettier * Fixed semantic validation errors * Fixed model validation * Another model validation fix * Debugging model validation errors * Using a different discriminator enum for output schemas * Fixed some missing discriminator updates * More semantic validation fixes * Fixed model validation errors; updated sample names * Fixed linting errors and addressed some warnings in the linter output * Ran prettier on examples * PR comments and some minor restructuring * Ran prettier * Removed a duplicate schema from CustomEntitiesTaskParameters * PR comments * PR comments * PR comments * Added missing job task status 'partiallySucceeded' * PR comments * Fix typo causing spell check error * Using common skip and top parameters * Using common StringIndexType definition * Reverted changes to taskName * Updated example * Description update * Description update * PR comments * Updated examples * Fixed issues in examples Co-authored-by: Abigail Hartman Co-authored-by: Kareem Yousef Co-authored-by: Abby Hartman * Add ontology field to Conversion V2 examples (#17673) * Check in public swagger for managed resolver (#17614) * Check in public swagger for managed resolver * Addressed code review suggestions * Fixed lint errors * Fixed empty space issue * Comment out all-tags-version * Fixed staging lint warnings * Removed the unreferenced file * Suppressed the rules * Modified the reasons for suppressions * Exact same files as the private repo * New changes on the top of private repo Co-authored-by: Arpit Gagneja * Fix update PublicNetworkAccess not work in Factory Update API (#17553) * Fix update PublicNetworkAccess not work in Factory Update API * fix an issue * update * Update ConnectAPIPolling.json (#17685) * Dev sentinel 2021 10 01 preview (#17494) * Adds base for updating Microsoft.SecurityInsights from version preview/2021-09-01-preview to version 2021-10-01-preview * Updates readme * Updates API version in new specs and examples * Add IoT data connector (#17086) * add Iot data connector * fix kind in getIotById * add deleted files * add missing newlines * fix newlines * Revert "Add IoT data connector (#17086)" (#17170) This reverts commit a11dd79ea1fb12c9b9d673fed2de91cc0098adbf. * Adding providerIncidentUrl & techniques to IncidentAdditionalData (#17173) * Adding providerIncidentUrl to Incident * Adding techniques to incident * Dev sentinel 2021 10 01 preview (#17314) * Bookmarks 2021-10-01-preview * prettier * definitions * rename Co-authored-by: Igal Shapira * Data connectors 2021 10 01 preview office connectors added (#17193) * Project and PowerBI specs added. * Space removed * File with a wrong name removed * More changer added * Example files with inconsistent naming removed * dataConnectors json updated * Ref fixed * Prettier applied Co-authored-by: Ido Klotz * AutomationRules preview 2021_10_01 (#17325) * h * first * examples * prettier * path * fixes * prettier * examples * Z * Z * responses * fix * fixes * fix * prettier * PR Fixes * PR Fixes * PR Fixes * fix * fix * fix * fix * Last * PR Fixes * Last * tryFix * tryFix * incidentTypes * fix Co-authored-by: Roy Reinhorn * Add MITRE support to alert rules models (#17198) * Update alert rules models with tactics and techniques * Add attack tactics new enum values * Update alert rules models examples * Fix techniques type * Update files with prettier * Insert validations fixes * Fix validations * Fixes in alert rules models * Fix alert rules models and examples * adding changes to alert rules json * Revert "adding changes to alert rules json" This reverts commit 603490e300c76dee48550a11d0dee8fe5c824a2e. * Adding fusion v2 ui api documentation * some fixes * adding prettier fixes * removing unwanted property * updating the readonly properties Co-authored-by: Lilyan Cohen Co-authored-by: Vishal Kumar * ErrorResponse changed to CloudError (#17477) Co-authored-by: Ido Klotz * Done (#17488) Co-authored-by: Roy Reinhorn * Adding tenantId (#17533) Co-authored-by: Ido Klotz * Done (#17556) Co-authored-by: Roy Reinhorn * Fix LindDiff and SemanticValidation (#17584) Co-authored-by: ShaniFelig <74960756+ShaniFelig@users.noreply.github.com> Co-authored-by: roherzbe <52486962+roherzbe@users.noreply.github.com> Co-authored-by: Igal Co-authored-by: Igal Shapira Co-authored-by: Ido Klotz Co-authored-by: Ido Klotz Co-authored-by: royrein <37300636+royrein@users.noreply.github.com> Co-authored-by: Roy Reinhorn Co-authored-by: lilyanc02 <46589651+lilyanc02@users.noreply.github.com> Co-authored-by: Lilyan Cohen Co-authored-by: Vishal Kumar * [OperationalInsights] Remove unsupported version 2021-06-01 for "Tables" resource (#17490) * Dev weather microsoft.maps 1.0 (#13796) * Remove preview from Weather API, remove X-Publish, and convert X-ms-enum ModelAsString to true * Revert changes to package-lock.json * Fix spelling error * Adding Azure Object Anchors error codes for IngestionProperties (#13787) * Added Azure Object Anchors error code field to IngestionProperties * Fixed spacing in example * Moved changes to new version * Addressed version mismatch, spacing * Fixed versions on examples * Readonly error code * Seeing if readonly error code is breaking * Revert "Seeing if readonly error code is breaking" This reverts commit c0b16f07c4a46a07fc7831a1735bb290804242ea. * Model error code as string * Renamed examples to asset conversion nomenclature * Fixed rename issues * Fixed issue #9593 (#13262) * Fixed issue #9593 * Removed redundant PrivateEndpointConnectionProperties attribute * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-05-01 (#13800) * Fixed Swagger Validation Errors * Fixed Model Validation * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 (#13788) * Fixed Swagger Validation Errors * Fixed Type * Fixed Type * Fixed Setting Properties * Fixed Punctuation * Removed Item * Added Items Properties * Fixed Required Property * azurestack wave4 t2 config (#13813) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. (#13490) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. * Add system metadata to tracked resources in "Microsoft.AppConfiguration". Updated ConfigurationStore to reference the common tracked resource type definition. * Added disableLocalAuth property. * Add new api version swagger to readme. * Added/updated examples and added suppressions for standardized APIs. * Fixed prettier. * Add missing property fileStorageSkuName into MySQL Flexible Server spec (#13693) * appplatform t2 readme config (#13829) * customproviders t2 readme config (#13831) * Update readme.csharp.md (#13807) * [Sentine][Data connectors][Fix correctness bug] (#13175) * update required fields * update required fields * Explicitly define KeyCreationTime in Feb21 (#13757) * Explicitly define KeyCreationTime Explicitly define KeyCreationTime * Fix KeyCreationTime Example Fix KeyCreationTime Example * Add Microsoft.M365SecurityAndCompliance RP (#13646) * Add Microsoft.M365SecurityAndCompliance RP * fix datetime and common-types file path * update common-types file path * add preview path in readmego * replace stable with preview * remove duplicate tags * refer MIPPolicySync json in readme * service name for java (#13837) * Dev keyvault microsoft.key vault 2021 04 01 preview (#13585) * Adds base for updating Microsoft.KeyVault from version preview/2020-04-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Open API change for Managed Hsm private endpoints feature (#12938) * Open API change for Managed Hsm private endpoints feature * Fixing spell check errors * Fixing spell check errors * Prettier fixes * Fixing swagger validation errors * Fixing systemData property reference * Adding publicNetworkAccess property based on private endpoint requirement. * GET responses following a successful DELETE should be returning 404. … (#13054) * GET responses following a successful DELETE should be returning 404. Only the DELETE response is to return 204 if the resource didn't exist (it allows idempotent deletes). (cherry picked from commit b752a19c6cc1f8a8eed9f106e2c77b8d5b5db19f) * Removing 404 as it is taken care by default response. * Added new routes for Deleted ManagedHsm for Soft Delete Feature (#13282) * Added new routes for Deleted ManagedHsm and examples, updated ManagedHsm definition to include PurgeDateTimeUTC * Fixing validation issues. * Fixing errors in properties in example jsons * Delete keyvault.json Deleted an errant json file * Fixed misspelling of property in examples * Fixed x-ms-examples naming, fixed camelcasing * Addressing comments in PR to make 204s 404s and also changing PurgeDateTimeUTC to scheduledPurgeDate * Added schema definitions for 404 * Removed 200 for purge Co-authored-by: Soohwan Kim * Addressing Comments for PR 13585 (#13586) * Removed 404s to allow requests to fall through to default * Removing 404s from examples Co-authored-by: Soohwan Kim * Added deletedmanagedhsm object to examples and managedhsm.json (#13591) * Added deletedmanagedhsm object to examples and managedhsm.json * Fixing error in references to correct values * Changed vaultId to mhsmId in exmaples Co-authored-by: Soohwan Kim * Try to use the common type for SystemData (#13723) * Add SystemData property for KeyVault * 04012021 fix schema (#13749) * Resolving conflict with custom-words.txt * Add 2021 preview to azureresourcechema, add suppression to readme * Add 2021 preview to azureresourcechema * Merging custom-words.txt Co-authored-by: Soohwan Kim * Add missing default error response (#13762) * Fix Lint error (#13765) * Add missing default error response * Update the integer format to fix Lint error * Add securityDefinitions * Added python tag for 2021 preview (#13805) Co-authored-by: Soohwan Kim * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (#13822) * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (cherry picked from commit c1c5aebfb98cacd0a4ee5596fb7b0d9f782a9a3e) * prettier fix * Add suppression for SystemData (#13835) * Add suppression for SystemData * Fix linting error R4036 - ImplementPrivateEndpointAPIs * specify the suppression for SystemData * Revert "specify the suppression for SystemData" This reverts commit cbebab81ab08ec1a29b41c891c58cf08ff2eb3c4. Co-authored-by: jiacheng-L <71623842+jiacheng-L@users.noreply.github.com> Co-authored-by: kim-soohwan <40476315+kim-soohwan@users.noreply.github.com> Co-authored-by: Soohwan Kim Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> * hybridnetwork only track2 configure (#13832) * hybridnetwork only track2 configure * remodify * namespace del Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * terraform readme for alertsmanagement (#13744) Co-authored-by: Your Name * add tags back in the adp readme (#13850) * Add device principal type (#13799) * copy files from previous version * add device principal type, update versions * fix * system data requirement * Added CheckNameAvailability, Identity, systemData, used ErrorResponse v2 in DeviceUpdate (#13750) * Update deviceupdate.json * Update deviceupdate.json * Add files via upload * Update deviceupdate.json * Update deviceupdate.json * Update Accounts_Update.json * Update Accounts_Create.json * Update Instances_Create.json * Update deviceupdate.json * Linux line ending * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update deviceupdate.json * Update deviceupdate.json * fixed typo in the example files (#13764) * Update CODEOWNERS (#13795) Updating list of Azure Cognitive Search team members * Update GenerateDetailedCostReportBySubscriptionAndTimePeriod.json (#13772) Update example data * [Hub Generated] Public private branch 'stuartko/Mar21_NewTSVersion' (#13811) * Adding version 2021-03-01-preview (copy of previous version) * Adding new metadata property * Adding uiDefinition property. * Update uiDefinition name to uiFormDefinition (per a change by the service feature author). No change to functionality. * Template Specs: Renaming template to "mainTemplate" and changing "artifacts" to be more specific "linkedTemplates". * Swagger changes for 2021-02-01-preview api version (#13794) * Copy existing preview version * Changes to databoxedge json file * Update readme files * Correct Spell Check * Fix Readme.go error * Update examples * Update all schemas.md files (#13862) * typo: implmentation -> implementation (#13644) * Add MongoDB/MongoDBAtlas sink (#13669) * Add MongoDB/MongoDBAtlas sink, add disableMetricsCollection in read/wirte properties * Revert disableMetricsCollection related changes * Azure ML new API version 20210401 (#12981) * Add Identity to createWorkpace example * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * revert change on transitivePE and notebookKeys * revert change on transitivePE and notebookKeys * add new stable version 2021-01-01 * add ListNotebookAccessToken * add primaryUserAssignedIdentity * fix missing properties and apis * fix one more missing property * 202 status for start and stop CI * make resync keys long runnin operation in version Jan2021 * resync keys 204 * update resync keys example * Dont throw 204 for resync * update resync keys * Formatting * revert Jan2021changes and add new version * start apr2021 version for azure ml rp * undo remove new line in jan2021 * use systemData definition in common * removed old files * fix small swagger bugs * run prettier * remove reference to sku * update readme * minimum agentCount should be 0 * add createdOn and ModifiedOn to compute properties * add LoadBalancerType to aks compute * add isNotebookInstanceCompute to virtualMachine * add leafDomainLabel to SslConfiguration * add overwriteExistingDomain to SslConfiguration * add synapseSpark as supported compute-type * update patch compute response to 202 * remove location from example responses * Revert "remove location from example responses" This reverts commit 048bf2551513afae842a9c4fbb5861aeddc6c33a. * MachineLearningCompute_Update should have a 200 response * sys data to use local def due to naming conflicts. * Fix enum casing * Fix operationId PR comment. * Change opId in apr version * remove 20210401 for easy review * only change api version * merge changes for 20210401 version * Add x-ms-discriminator-value for Synapse spark * camelcase loadbalancer properties * add createdOn and Modified on to examples * address AvoidAnonymousTypes error for SynapseSpark * Minor fixes + new property * Remove subscription state. Co-authored-by: zhaomuzhi Co-authored-by: Vinay Rajmal Soni Co-authored-by: jopet@microsoft.com Co-authored-by: Josh Peterson <15050193+joshanator@users.noreply.github.com> * datashare readme t2 config (#13833) * add readme terraform (#13717) * adding a new API version for Restore API and adding targetVirtualMachineId field for AzureWorkloadRestoreRequest (#13638) * copying previous change * Adding targetVirtualMachineId field for Azure Workload Restore requests * updating crr version and examples * removing new api-version * adding back the new api-version * removing Snapshot related fields * updating readme.md * corrected the path Co-authored-by: Chandrika Gonuguntla * chore: resort custom-words.txt from bad merge (#13868) * [ApplicationInsights] Fix failure for python SDK (#13875) * [Hub Generated] Review request for Microsoft.Insights to add version preview/2020-10-05-preview (#13712) * Adjustments to API to include validation grouping and updated text. * Fixed missing curly brace * adjusted name * Added basic and standard examples * adjusted type. * corrected case for key value * [Hub Generated] Review request for Microsoft.Insights to add version preview/2021-03-03-preview (#13269) * Adds base for updating Microsoft.Insights from version preview/2020-10-05-preview to version 2021-03-03-preview * Updates readme * Updates API version in new specs and examples * Add DiagnosticServiceToken API * Update examples to split tokens for readonly vs readwrite * Fix accoding to code review feedback * Update examples due to review feedback from ARM * add configuration for vmware (#13879) Co-authored-by: Your Name * keyvault t2 config (#13863) * keyvault t2 config * keyvault multi-api config * multi api config * config reset * add package version * hanaonazure t2 readme config (#13880) * Remove x-ms-azure-resource (#13500) Co-authored-by: Dongwei Wang * Juniwang/sr202010401preview (#13664) * prepare to add new api-version: copy everything from 2020-07-01-preview * Adding new api-version * Fix required body and annotate ms secrets * remove secrets example from swagger * fix prettier * add datashare terraform configuration (#13876) Co-authored-by: Your Name * storage readme t2 config (#13881) * storage readme t2 config * storage t2 config * healthcareapis t2 config (#13884) * typo: APIkeys -> APIKeys (#13641) * Allow release_policy to be nullable (#13826) * Fix type of Anserws and Captions (#13872) * change the value of license header (#13886) * [Synapse] - library_append API adds comp parameter (#13841) * [Synapse] - add comp parameter * Update example files Co-authored-by: Dongwei Wang * Remove 200 response from async operation (#13190) * Async operation always returns 202 on initial call * Address review feedback * Revert "Address review feedback" This reverts commit 9ae550b95c1082c8383595a943a9abe5990fd4ef. * add minimal tls version for mariadb (#11779) * [Synapse] - add Swagger code owner (#13882) Co-authored-by: Dongwei Wang * add con figuration for databoxedge (#13877) Co-authored-by: Your Name * add configuration for resourcemover (#13878) Co-authored-by: Your Name * Reduce code owner scope for Monitor.Exporters team (#13898) * [portal]Update readme.python.md (#13907) * Update readme.python.md * Update readme.md * Update readme.python.md * Update readme.python.md * Dev dfp microsoft.dfp 2021 02 01 privatepreview (#13305) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * DFP API specs. Copied from Azure-PPE * Spelling fix. instnace => instance * Fix resource provider name to pascal case * Added '/providers/Microsoft.Dfp/operations' * Added SystemData (fix R4009 error) * Fix validation errors * Prettier fixes * Removed non-existend parameter sku * Style fixes in DFP API specs * Swagger ModelValidation failures fix * Fix operations API * Fix operations API validation failure * 1. Added example for lists operations. 2. made the API preview instead of privatepreview * Fix path in readme's * Fix in readme * Added readonly attribute to systemdata * Added readonly attribute to systemdata * Fix in python SDK readme * Fixes in ListOperations.json examples * Fixed API version * Added type to response bodies * Fix typos in examples (urls) * Added 201 response into createInstance example * Renamed RP name from Microsoft.Dfp to Microsoft.Dynamics365Fraudprotection * Added long-running result for creation instance * Added nextlink * Fix in checkNameAvailability definition URL * Next link parameter * Using references to common types instead of re-declaring them * Reused common type. Fixed provisioning state * Nesting error fix * Fixed examples * Fix * Fix in error response definition * Rename RP. Fix examples in readme's * Added http 202 * Added http 202 to examples * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-10-01 (#13818) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-09-01 to version 2020-10-01 * Updates readme * Updates API version in new specs and examples * Adding new fields for 2020-10-01 * Updating wording for disablePasswordAuthentication' Co-authored-by: jmccarthy * Remove name check from client side (#13492) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * Update deviceupdate.json (#13900) * [Hub Generated] Review request for Microsoft.ResourceHealth to add version stable/2018-07-01 (#13817) * Updated api-version * Removed systemData * Updated api-version * Updated the example * Add EligibleChildResources resource for PIM + update examples (#13803) * PIM API Specs * update readme * Update * Update readme * operation id fix * name fix * Name changes * fix * Fix * Changes based on docs generated * Scope fix in example * Updates for documentation * Change operation name * Update examples * Add expanded properties * Fix formatting * Fixes * Fix * fixes * Update the policy specs * Fix the policy objects and pell checks * fix the checks * fix the property * fix syntax * Prettier * Update Examples * Update Enums * ADd eligible child resource API specs * prettier fix * Update read me files * update * update * fix * update * Update Enums * update * update * update * update example Co-authored-by: Aman Swaika Co-authored-by: Gaurav Mishra (IDENTITY) * refine readme.go.md (#13906) Co-authored-by: Your Name * [Service Fabric Managed Clusters] adding api version 2020-05-01 (#13860) * initial commit 2021-05-01 to compare with previous version 2021-01-01-preview * update models * update examples * fix isStateless description * add 2021-05-01 version to readme * add x-ms-enum to diskType and add missing managedClsuterVersions paths fix example names add managed cluster version paths add default error * fix clusterversion by version and ClusterState descriptions Co-authored-by: Alfredo Santamaria Gomez * Task 9639284: Swagger changes for new UK agreement templates (#13895) * Task 9639284: Swagger changes for new UK agreement templates * Renamed as per comments. Co-authored-by: Umang Shah * Confluent new preview version + S360 fix (#13809) * Adding new API version for Microsoft.Confluent * Prettier fix * updated status property in OfferDetail updated status property in OfferDetail to fix swagger correctness issue * fix swagger live validation updated operations response to fix swagger live validation Co-authored-by: Srinivas * [Hub Generated] Public private branch 'juniwang/wps' (#13905) * Onboarding Azure WebPubSub service * reference ErrorResponse from common types and adding network ACL * disable cors, enable feature flags and fix several policy violations * remove anonymousConnectPolicy since it's not ready for now * add property publicNetworkAccess per NRP requirement * revert package-lock.json * reset package-lock.json * dns t2 readme config (#13923) * update readme (#13918) * add current readmes for generating python form recognizer (#12013) * add current readmes for python form recognizer * fix release tag * updates for multiapi and preview.3 * fix so that gen code outputs in generated folder * remove tag since swagger not in yet * unbreak build * just target preview 3 * don't run track 1 gen with python * Set x-ms-api-version to false for vaults list (#13924) * Set x-ms-api-version to false for vaults list (#13925) * Update event description to include the event name (#13867) * Update event description to include the event name * Update readme to include guidelines for defining a new event * Fix description * Renamed enum values for SDK auto generation (#13938) * Renamed enum values for SDK auto generation * Tabs to spaces * Newline added * [Document Translator] update operation names (#13915) * update operation names * make body required * Update ErrorName * Apply changes to stable * Fix samples * fix sample * Fix glossary sample * Address comments and update definitions names * Revert "Task 9639284: Swagger changes for new UK agreement templates (#13895)" (#13946) This reverts commit ea5bc27ee9cadeb67767d774c82095be2420bcad. * Adding new preview API for promotions (#11599) * Adding new preview API for promotions * Avacado fix * Fixing JSON * fixing the promo param * fixning linting issues * Fixing JSON * fixing JSON * fixing linting issues * Adding delete 204a * Adding delete 204 * Adding validation fixes * fixing spellings * Linting issues * running prettier * ARM review feedback * Fixing linting issues * Fixing prettier * Fixing version * Fixing SDK * fixing go sdk * revert go.md Co-authored-by: Rishi Kapoor * Exposing undocumented Databricks workspace properties for fixing S360 issues (#13683) * exposing storage account name, sku * Prettier fixes * Fixing the review comment * Adding No Public IP related properties * Updating the remaining properties related to S360 * Fixing review comments * Fixing Spell Check issue * hybridcompute readme t2 config (#13910) * readme t2 config * hybridcompute t2 readme config * web readme t2 config (#13909) * web readme t2 config * web readme.python t2 config * Add x-ms-api-version (#13834) * Update CheckNameAvailability_Available.json (#13914) * webpubsub t2 config (#13949) * Update StaticSite.json (#13768) * Update StaticSite.json Add private endpoint connections to static site object. * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * increment readme version * address PR comments * add examples * fix examples * Add data-plane samples creation template (#13528) * Add data-plane samples * Simplified template * webpubsub readme t1 del (#13953) * Add $(multiapi) to QnA Maker's readme.md (#13819) Generators were processing every tag when only a single one was desired. This is the common solution to support multi-api SDKs. * IoT data-plane for drwill-ms (#13964) * add missing usage.json to v5 sdk tag (#13960) * [Hub Generated] Review request for Microsoft.Kusto to add version stable/2021-01-01 (#13306) * Add new api version 2021 * remove managedIdentity since we won't support it in this version * CR comments * Add default value for contine on errros * Fix swagger correctness issues * Fix typo * resource t2 readme config (#13974) * Added new API and API version for private DNS zone suffix (#13789) * Added new API and API version for private DNS zone suffix * trigger validation pipelines * Add new API to readme * Fix ARM pipelines * Try fix again * Fix again * Add Operations API * Revert "Add Operations API" This reverts commit 9d4ca9e557763feb3a6089ff9d4c958b3843730e. * Revert "Revert "Add Operations API"" This reverts commit 7cf197c1d453764f0396713a2ab172a20e35b1c4. * Revert "Revert "Revert "Add Operations API""" This reverts commit 05744390e440984da8134b64a979a6e61fb9b7ae. * Revert "Revert "Revert "Revert "Add Operations API"""" This reverts commit 61b76b1623d9e5796bb8187edf0fc46351e78231. * Revert "Revert "Revert "Revert "Revert "Add Operations API""""" This reverts commit 9f55eb4c399eb48a8578906f6bea43b10c91b8be. * Address review comment from ARM * Revert "Address review comment from ARM" This reverts commit cb6d1b01860de72eec80856f64b602c72a1f26a7. * Revert "Revert "Address review comment from ARM"" This reverts commit 227cf73797ee24a674d76e3ccd2990b84bc8d11a. * Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API"""""" This reverts commit 34ae6c70a514e0290ffb41f7ddb5bbbd5c6cbee3. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API""""""" This reverts commit a11c889a65b0fa4257b03a247d75fbea769f4e2c. * Add previous APIs to tag * Retrigger build * fix service name for Java (#13979) * Add optional param - private DNS zone to server API (#13716) * Add optional param - private DNS zone to server API * Follow comment to resolve go sdk issue. * [Hub Generated] Review request for Microsoft.Synapse to add version preview/2021-04-01-preview (#13874) * Adds base for updating Microsoft.Synapse from version stable/2021-03-01 to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * add changed files for kustoPool * Ravi changes to fix LinDiff validation * Add Itay Sofer's changes * filizt comments mid-way * Remove clouderror and resplace with "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" * Add IotHubDataConnection and EventGridDataConnection * Modify PUT to OK, CREATED, ACCEPTED * Change from provisioningState to ResourceProvisioningState * Add BlobStorageEventType * Remove 202 when creating a KustoPool * Change PUT/PATCH 202 responses * Remove 202 in PATCH/PUT operations where having both 200 & 201 * Add "isIdentityCertExprired" to custom-words.txt * Remove isIdentityCertExprired from custom-words.txt * Add Exprired to cSpell.json Co-authored-by: Amit Elran * Removing x-ms-flatten property (#13929) * manual changes for swagger * changes for long-running operations * changes for validate for backup and restore * removing 204 from operationResults * changes for a monitoring * adding format * removing date-time from duration * changing to readonly * changes for listRPs * fixes swagger * reverting readonly for scheduleTimes * fixes for checkgates * prettier fixes * cahnges for friendlyname checks * fixing gates * removing tracking-via * model validation fixes * powershell changes * adding stable version * changes for PatchResourceRequestInput * change for req fields * changes for description * changes * Updated swagger json for item level restore target info objects * Fixed spelling errors * Added missing required properties * removed auth credentials property * prettier fixes * Prettier fix * pr comments fixes * fixing readme * changes for go readme * Removed x-ms-flatten property (#2) * removed flatten prop * removing x-ms-flatten * removing friendlyName from req prop Co-authored-by: Mayank Aggarwal Co-authored-by: Mayank Aggarwal Co-authored-by: FAREAST\zakinkh * confidentialledger readme t2 config (#13981) * Additional 7.3-preview parameter name clean up (#13913) * Enable multivariate anomaly detection (#13973) * add multivarite * add v1.1-preview * reformat changepoint example * change typo in readme * fix prettier-check error * add export model example * fix prettier error * [Azure Search] Add Knowledge Store feature to swagger (#13911) * introduce knowledge store swagger * add knowledge store to 2020 apis Co-authored-by: Austin Drefke * make skillset count optional, and add it to 2020 GA Swagger (#13990) Co-authored-by: Austin Drefke * Adding support for message properties in ACS Chat (#13939) * Initial commit (copying over stable API version) * Making changes to support message metadata * Added 201 response code for patch operation (#13956) Co-authored-by: Akash Keshari * Adding autoMitigate flag with false as default value (#13109) * deploymentmanager - clean up duplicate parameters outside of method (#13948) * clean up duplicate parameters outside of method * maintain python order * fix typo in Synapse (#13994) * OperationalInsights - update readme files for cli extension update (#13999) * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * added Tables new api version * changed bool to boolean types * prettified jsons * fix erroes in swagger * undo changes to 2020-03-01-preview version * pr fixes * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * changed ErrorResponse to default ErrorResponse without ref to local definition * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed SystemData * creatted a new package containing all latest swagger files for publishing new SDK * removed package 2021_02 and set default packate to 2020_10 * removed 2 packages * removed DataCollectorLogs.json from readme.md 20202.10 * added empty line to try invoke pipeline validations that havent run * Delete Tables.json * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * merge * prettified jsons * undo changes to 2020-03-01-preview version * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed whitespaces * changed DataExportErrorResponse to common .../v2/types.json#/definitions/ErrorResponse * changed all Error response of 2020-08 to common definition * added readme.az.md file for cli extension code generator * added readme.ad.md with the same naming convention as in readme.python.md added readme.cli.md file updatted readme.md file with the new azure-cli-extensions tag all updates were done by following: https://github.com/Azure/autorest.az/blob/9ed1aabd353385f8bdffbfa9f3892478111a029c/doc/how-to-author-readme-file.md * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * added azure-powershell to readme.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * [Cognitive Services Metrics Advisor] add missing required for allOf entities (#13957) * add missing required for allOf entities * fix incorrect required properties * 7.2-Preview to GA (#13919) * 7.2-Preview to GA * Update packages to point to stable * Readd exportable and update description * Update description for exportable in preview versions * Fix operation results contract for Tenant Git operations (#13903) * fix operation results contract * fix sync state contract * iothub t2 readme config (#13980) * iothub t2 readme config * iothub readme t2 config * iothub t2 readme config * Making Offer details and User Details required properties (#13985) * Making Offer details and User Details required properties and removing abandoned tag * fix python configuration * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * cosmosdb t1 config del (#14008) * Fixing issue with missing filter documentation in Access Review APIs (#13892) * fix cred issue. block to merge in DSMainDev (#14014) * fix serivce name for java (#14007) * maintenance readme t2 config (#13982) * maintenance readme t2 config * readme t1 config * [Service Fabric Managed Clusters] fix api 2020_05_01 (#13961) * Use enums and add missing properties * model enum as string Co-authored-by: Alfredo Santamaria Gomez * [Hub Generated] Review request for Microsoft.BotService to add version stable/2021-03-01 (#13784) * add isIsolated and channelSchemaTransformationVersion * rename * add v2 priavatelinks (#14026) * copied from v1/privatelinks.json * bump version Co-authored-by: jianyexi * APIM: improve developer portal operations docs (#13941) * APIM: improve the documentation for dev portal operations * Minor changes * Removing OData parameters from the stable API version * Remove new query params * hotfix on extended location hierarchy (#13943) * [Hub Generated] Public private branch 'wps' (#14002) * Add webpubsub swagger Add custom words Update webpubsub.json Update webpubsub.json Resolve comments Update webpubsub.json resolve comments Update operationId for existence check [wps] update python generation section and client name for all languages (#1) * add python stuff * make title across languages the same * Update version * Update some constraints * Update webpubsub.json * rename to GetServiceStatus * Update readme.md * Update readme.md * Update readme.md * [Hub Generated] Review request for Microsoft.SecurityInsights to add version preview/2021-03-01-preview (#13563) * Copied from 2019-01-01-preview version * Updated references to common types * Add itemsSearchKey field to Watchlists * Add missing label definition * Make itemsSearchKey as required field * Formatting fixes * Fix Prettier and Avocado errors * Fix Lint error (subscription level resource) * Update description and example for CreateOrUpdate watchlists and bulk create watchlist items * Update Api version in examples * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13888) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * updated default package in readme.md to 2021-03 Co-authored-by: Chandrika Gonuguntla * Updated required and default fields in Action Groups spec (#13677) * Updated error response for Action Groups API * spacing * added missing fields to Action Group Resource spec * Added missing fields for action group resource in older version * Updated "resource" name * Removed changes to errorResponse * Removed errorObject * format * Updated required and default fields in Action groups spec * Update default value to boolean Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * changes default value type to boolean * undo webhook receiver changes Co-authored-by: Ritwik Rajendra Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * Remove AML Compute File Server (#13944) * Remove AML Compute File Server * update * update * update * update * Cost Management: Reservation Recommendations API: Add multiple missing properties in specs (#13967) * added totalCost, properties.resourceType, properties.subscriptionId, and eTag to various RiRec dfinitions * moving eTag property to right place * remove duplicate description * remove track1 configure (#14044) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * New API version (2021-02-10) for recovery services site recovery (#13525) * Adding old API version(2018-07-10) to new folder for 2021-20-10 * all changes for swagger (2021-02-10) * read me and custom word changes * Ayesha's comments addressed * adress PR comments from ayesha * Adding suppressions * fixing custom words * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13636) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-02-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * Update readme.md changing read me to include date too in tag * cahnging examples API version to 2021-02-10 * fix read me syntax * TaskStepProperties swagger fix (#13971) * Adding "assignmentState" property to scope model in access review APIs (#14039) * iothub readme.python package version change (#14043) * iothub readme.python package version change * multiapiscript add * clear output folder * Update readme.python.md * Update readme.python.md * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Bump y18n from 4.0.0 to 4.0.1 (#13704) Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update (#14061) * package-templatespecs-2021-03-preview tag added (python) (#13958) * Added tag * nit: ordering Co-authored-by: Dania Etienne * Use 2014-04-01 replication link specs in V5 SDK (#14058) * Use 2014-04-01 replication link specs in V5 SDK * remove legacy file. * Update cSpell.json for Key Vault 7.2 (storage) (#14060) * automanage readme t1 del (#14029) * automanage readme t1 del * automanage readme t1 del * readme.md t1 config del * add missing reference (#13904) * databoxedge readme modification (#14063) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * managedservices t2 onfig (#14064) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13635) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * fixing merge issue * removing vault usages from 2021-02 * Adding back vault usages * updating readme * updated etag to eTag (#13968) * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-12-01 (#13931) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-10-01 to version 2020-12-01 * Updates readme * Updates API version in new specs and examples * Adding new spot VM fields Co-authored-by: Joshua McCarthy * Add FaceAPI PersonDirectory spec updates to preview v1.0 (#13766) * Add FaceAPI v1.0-preview Add a preview version of FaceAPI specs intended for public preview. Contains existing spec in v1.0 plus PersonDirectory feature changes. * Fixes after running validation * Fixing validation * Fixes 2 * Fixes 3 * Add PersonDirectory examples and fix routes * Fixes 4 * Fixes 5 * Fixes 5.5 Co-authored-by: Yang Chen * Update the name and format of a parameter for randomnumbers (#14017) * Update the name and format of a parameter for randomnumbers * Change the parameter name from 'bytes_length' back to 'bytesLength' * Amalladi/extendedlocation update (#13849) * Updating Specification to remove 400 Badrequest from Swagger File * Removing 400 status code from examples * Removing private preview API version from Repo * Removing 2020-07-15-privatepreview tag from ReadME files Co-authored-by: Aditi * maps t2 config (#14075) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * Revert "remove track1 configure (#14044)" (#14047) This reverts commit 867165cc24d81c487ad186c998c46ba55f81c77b. * adding role assignment (#14077) * add connectionPolicy spec back to V5 SDK (#14088) * modification (#14087) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-04-01-preview (#13710) * Adds base for updating Microsoft.DocumentDB from version preview/2021-03-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * adding Services APIs * more changes * updated examples * prettier and readme updates * importing changes missed from old versions * nits * fixing semantic validation * fixing linter * fix * more fixes * adding list operation and default error response * specifying format integer * attempt to fix sdks * address arm comments and fix ci * fixes * fix * try to fix ci * fix examples * .\services.json * adding additionalProperties back to ServiceResouce * adding additionalProperties back to ServiceResouce * fix * fix sdks * fix linter Co-authored-by: Meha Kaushik Co-authored-by: Meha Kaushik * media t2 config(wave4) (#14074) * media t2 config * add packageversion Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.Maps to add version stable/2021-02-01 (#13733) * Adds base for updating Microsoft.Maps from version preview/2020-02-01-preview to version 2020-02-01 * Updates for 2021-02-01 api version swagger * creator swagger fixes * fix model examples * nextLink, uniqueId * build fixes * fixing listkeys * fix long running operations * fixing spelling * fixing async behavior and examples * updating arm region * reset package-lock * [Hub Generated] Review request for Microsoft.Media to add version preview/2021-05-01-preview (#13838) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy Signed off 2021-03-01 swaggers here * Update swaggers to 2021=05-01-preview * add missing examples * update title * fix Operation id * fix video analyzer examples * update Video swagger * add format for $top * remove unnecessary example file * use chackname definitions from types.json * fix segment length readonly * change getStreamingToken to listStreamingToken, getProvisioningToken to listProvisioningToken * fix the example file name * fix a readonly issue with a video property * make type readonly * edits to descriptions * adding missing descriptions * address review feedback, * few cleanup for update class Co-authored-by: Christopher Bennage * Include the preview version of resource changes and resources history… (#14084) * Include the preview version of resource changes and resources history APIs * Address the review feedback on releasing the new package version. * Update readme for Synapse management SDK May release (#14054) * Update readme for Synapse management SDK May release * Add package-2021-05-preview * Address comment Co-authored-by: Dongwei Wang * removing read only property, no longer in use - NOT a breaking change (#13812) * resources readme.python t2 config (#14091) * peering readme t2 config (#14106) * Remove replicationLinks_legacy.json (#14095) PR #14058 removed this file: replicationLinks_legacy.json, removing from the schema config to prevent schema generation failures. * Support sheet index in excel (#14062) * Enable excel in public swagger * update * rollback dataflow change * Support sheet index in excel Co-authored-by: zhanyu2014 * Adding 2021-05-01 api-version to Template Specs (no changes over last preview spec) (#14065) * Copy existing 2021-03-01-preview specs to new 2021-05-01 stable version (no schema changes) * Changing api-version within specs to 2021-05-01 * Adding package tag for new stable version to readme.md, but not making it a default (yet) * Fix SecurityInsights Go SDK versioning (#14030) * Fix SecurityInsights Go SDK versioning * rename stable api version tag * remove 'only' from tags with full functionality * chore: Move typo supression in RecoveryServices (#14120) * Add missing Zone mapping property to Microsoft.Resources (#13936) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * add zoneMappings to ResoursesType * backfill older versions of swagger with zonemapping property * [Application Insights] Resolve duplicated definition names to fix track2 SDK generation error (#13951) * Fix duplicate name * Update readme.md * Update readme.md * Update and rename workbookOperations_API.json to aiOperations_API.json * Update readme.md * Update workbooks_API.json * Update readme.md * Update readme.python.md * Update readme.md * Update readme.md * Update readme.md * Rename aiOperations_API.json to workbookOperations_API.json * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update swagger for SSIS-IR to support user-assigned managed identity (#14114) Co-authored-by: Hongxian Yao * postgresql readme t2 config (#14067) * Dev mediaservices microsoft.media 2021 05 01 (#13676) * Adds base for updating Microsoft.Media from version stable/2020-05-01 to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * [AMS] new 2021-05-01 release for Account service in AMS * add missing example files * fix the api version and missing example files * Create a new Update definition to fix the "R2016 - PatchBodyParametersSchema " * fix respnse * fix update example * add the 2016 supression for new tag as well. * mixedreality t2 readme config(wave4) (#14105) * mixedreality t2 readme config * t2 config del * [python] t2-confidentialledger config (#14144) * Update readme.python.md * Update readme.python.md * Update readme.python.md (#14145) * update elastic swagger (#14076) * Update elastic.json * added new examples * taking the files from rpsaas master * added suppression in readme * [Cosmos DB] Introduce new api version 2021-04-15 (#13873) * [Cosmos DB] Introduce new api version 2021-04-15 Initial Commit * Updated for 2021-04-15 * Dummy Commit * Fixing privatelinkresources.json * Removing ErrorResponseUpdatedFormat * Suppressing systemData check * Relay - Fix typo in the NetworkRuleSet path (#13962) * Relay - Fix typo in the NetworkRuleSet path * Suppression - DefaultErrorResponseSchema - we will be Implementing in new API version * [Hub Generated] Review request for Microsoft.Portal to add version preview/2015-08-01-preview (#12732) * Fixing properties in dashboard parts * Updating Dashboard part metadata * Updating based on prettier fixes Co-authored-by: Himanshu Chandel * resources t1 config add (#14146) * t1 config add * package version * [Hub Generated] Public private branch 'dev-maintenance-Microsoft.Maintenance-2021-05-01' (#14148) * Adds base for updating Microsoft.Maintenance from version preview/2020-07-01-preview to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * Added system data properties. * Fixed lint error. Added documentation. * Use Host Maintenance scope and api version in exmaple. Co-authored-by: Kalpesh Chavan * Add Test Base Swagger Spec from RPSaaSMaster (#14113) Co-authored-by: Bin Yu * rename property: change category to categories (#13883) * Edit description of Update Iot Hub Resource Api (#13080) Co-authored-by: Harini * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13889) * Adds base for updating Microsoft.RecoveryServices from version stable/2018-07-10 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Update webpubsub.json (#14096) * add dataFeedId in AnomalyResult and IncidentResult (#14127) * add dataFeedId in AnomalyResult and IncidentResult * fix examples * Add new version 2021-03-31-preview1 for ACS Auth (#13965) * Add new version 2021-03-31-preview * Set required body * Add all paths to new version * Update description for property of TeamsAccessTokenRequest model * Change version from 2021-03-31-preview to 2021-03-31-preview1 following standards https://skype.visualstudio.com/SPOOL/_wiki/wikis/SPOOL.wiki/16790/Versioning * Rename folder * Update method description * remove Turn endpoint * Add examples * Update readme * Omit the word "skypetoken" from swagger * Link example * Update description and path for a new endpoint Co-authored-by: Alexandra Lamiova Pistrakova * Added example gneration document links (#14151) * purview scanning service (#14021) * purview scanning service * Add custom words for spellcheck * fix config files and add endpoint param Co-authored-by: Parv Saxena Co-authored-by: iscai-msft * MG RP new API versions: 2020-10-01 and 2021-04-01 (#13897) * API 2020-10-01 with 2020-05-01 files * 2020-10-01 API changes * 2021-04-01 API version with 2020-10-01 files * Changes for 2021-04-01 API * PR fixes * Fixed issues with model * PR fixes * Latest (#13917) * Pick up previous Swagger Fix in 2019-09-01 version (#14092) * Add missing swagger fix * Fix bad copy-paste * update the some capitalized words in the description * Adding EventData schema for Microsoft.Storage.BlobTierChanged event (#14049) * Adding EventData schema for Microsoft.Storage.BlobTierChanged event * Removing contentLength/Offset from Microsoft.Storage.BlobTierChanged data schema * Removing BlobTierInfo from BlobTierChanged and adding new event Microsoft.Storage.AsyncOperationInitiated * adding ContentLength for BlobTierChanged and AsyncOperationInitiated events * [Hub Generated] Review request for VideoAnalyzer.Edge to add version preview/1.0.0 (#13682) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy old LVA swaggers * Rename old swaggers to new file names * Update LVA swaggers with new AVA swagger * fixed some paths and capitalization * fix prettier check issues * fixing a Pascal casing * Updating swaggers to latest * fix linting issue * removed an unused definition * Service fabric Client API 8.0 (#14011) * spell checked and linted. * updated tag version. * reverted change outside of SF folder. * updated version in swagger. * changed credential issues. * changed 1 more that looks like a credential. * Kusto pools principal assignment (#14079) * kustoPool PrincipalAssignments * fixed list principal assignments * principalAssignment list example * principalAssignment get example * KustoPoolPrincipalAssignmentsCreateOrUpdate * KustoPoolPrincipalAssignmentsDelete * databases PrincipalAssignments * minor change * KustoPoolDatabasePrincipalAssignmentsList * KustoDatabasePrincipalAssignmentsGet * KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate * KustoPoolDatabasePrincipalAssignmentsDelete * fixed example ref * added system data * kustoPoolCheckNameAvailability * KustoPoolsCheckNameAvailability example Co-authored-by: Itay Sofer * [Service Fabric Managed Clusters] fix api 2021_01_01-preview (#14012) * Update preview api to disable broken properties and to add property that is working * Update managed cluster description * Add New Data Model RuleCollection to NetworkManager (#13827) * Add New Data Model RuleCollection to NetworkManager * fix typo * test * test * Fix discriminator * fix type * Fix discriminator * Fix type * fix type * Fix type * Fix discriminator * Fix discriminator * fix type * fix type * Fix bug * Fix type * Fix format * Fix name * Fix name * fix spell * fix description * Fix spell * change to kind * fix lint * fix lint * fix lint * fix lint * fix lint * fix lint * Fix post body * Fix as comments * fix bug * fix bug * fix bug * fix bug * fix bug * fix bug * change rule kind * Fix as comments * Fix as comments * update lastest version * Update type * Update Skiptoken * Fix discription * Fix NG * Fix NG * add more example * [python]Update readme.python.md for postgresql (#14182) * Update readme.python.md * Update readme.python.md * Remove all schema readme (#13885) * Remove all schema readme * process new rp * Remove after_scripts * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2021-04-01 (#13890) * Adds base for updating Microsoft.AlertsManagement from version stable/2019-06-01 to version 2021-04-01 * Updates readme * Updates API version in new specs and examples * first commit * some fixes * try without alert management * revert change to name of namespace * Resolve lintdiff issues * remove the copy of files and reference alert managment previous version * update description of subscriptionId to solve error * attemp to remove AlertsManagement from the package * revert (put back AlertsManagment) * add tags for go SDK release v54.0.0 (#14161) * add tags for go SDK release v54.0.0 * add a new tag * FRv2.1 GA Stable Release (#13997) * Standardized Errors, sample list. * removing from master from now as this is just a proposal * FRv2.1 GA Initial commit. Co-authored-by: Sandeep Parab * remove extra / from host template (#14176) * [Hub Generated] Review request for Microsoft.Batch to add version stable/2020-09-01.12.0 (#14170) * [Batch] Update RemoveNodes description to include max nodes/request * Added suppressions to readme * Update swagger for a new version 2021-03-31-preview1 for ACS Auth (#14168) * Unify names * Update tag * Update due to review meeting * update example description Co-authored-by: Alexandra Lamiova Pistrakova * Add new 1.0 version for IoT Central API (#13713) * Add new 1.0.0 version for IoT Central API * fix swagger style * fix wrong json file name * remove unused examples * revert back email format * remove non-used examples * update with latest examples * update preview from 2019-10-28-preview to 2021-04-30-preview * remove extra --- * update version from 1.0.0 to 1.0 * rollback collections for common entities * update _id to Id, update _name to Name from operation, add sdk generation * fix go sdk file * remove go sdk * updatedevicve_templateId to deviceTemplateId * Add query parameter based versioning, remove resource schema * fix example docs reference * fix typo in comments * renaming execute to run for command operations * add api-version to samples files, fix devices_update missining issue * add devices_update.json for 1.0 * fix rerun_id, add missing parameters to examples for preview, fix command comments from execute to run * fix annoymous type issues * add title to readme. (#14179) * videoanalyzers-fix-missing-host (#14181) * New API version for Microsoft.Resources stable/2021-04-01 (#14132) * base for Microsoft.Resources 2021-04-01 * update readme * update api version * API changes for S2S * readme Co-authored-by: Wendy Chang * Swagger Changes for Get Recoverable Servers and create server with Geo-Restore. (#14013) * Added Recoverable Servers API and GeoRestore API. * Fixed spell check and prettier * Fixed readme.md file issue and changed the postgreSQL to restore. * Fixed duplicate schema issue. * Fixed the mismatch with namespace names. * change the tag name from georestore to servers * Fixed the SDK validation issues. * Fixed objects w.r.t preview version * Fixed operation required properties. * Included 2020-04-10 in the SDK versions * Change the folder path. * Add missing multiapi entry for go sdk v54.0.0 release (#14200) * add missing multiapi entry * fix one output-folder * Azure security insights - add data connectors preview version (#13998) * add new API * ad name to enum * updatre defenition names * update readme * update readme * update readme path files * fix errors * add missing connectors * execute validation * execute pre * update readme * add description ans x-ms-enum * update description * update properties * add description * rename enum - fix new error that didnt display until now * rename enum unser x-ms-enum property * [Hub Generated] Review request for Microsoft.Maps/Alias to add version preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0 and preview/2.0 (#13921) * Copy Creator API 1.0 to 2.0 * draft of planB * adding ontology properties; adding DataUpload * updated alias apis * put v1 API back so diffing is easier * reapplying v2 so diffs are easier * remove type from datasetsources * incorporate suggestions from review board * adding ontology field * Update alias v2 apis. * fix conversion descriptions, update alias * Fix the alias file. * Add get details example. * fix casing on headers; mapData more consistent * minor comment and linting fixes * Adds base for updating Microsoft.Maps/Alias from version preview/1.0 to version 2.0 * Updates readme * Updates API version in new specs and examples * Add baseline from preview/1.0 * update api-version in examples * add v2 files to readme * fix avacado errors * Adding string length limit to the descriptions for feature state. Adding string length limit to the descriptions for feature state. * Adding ontology element to the WFS resopnse examples. Adding ontology element to the WFS resopnse examples. * Updating length to 1000 from 1024. Updating length to 1000 from 1024. * Update dataset v2 descriptions and examples. * Update the examples to have the right details. * reran linter; added spellcheck words * more linting: 202 description alignment * fixed example linting for alias, data, dataset * example linting changes for conv, fs, tileset * change featurestateset patch to put * autorest linting fixes * Reverting FeatureState body to include array to match V1 body and response. * adding missing operationIds * added examples; more linting * remove x-ms-long-running * Update alias documentation for resourceId -> creatorDataItemId change Co-authored-by: Robert Johnson Co-authored-by: Subbarayudu Kamma * Update attribute name for message metadata (#14206) * Update attribute name for message metadata * Apply Prettier * Prettier fix Co-authored-by: Po Tsang * Re-add a previously erroneously removed PUT API for /networkConfig/VirtualNetwork (#14018) * Add CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck, and site-level virtualNetworkSubnetId field * Add site-level virtualNetworkSubnetId field * Tabs vs spaces * Removing the new property since it's technically a 'breaking change' * Add changes needed for correct .NET SDK generation issues. Reference PR: https://github.com/Azure/azure-sdk-for-net/pull/20300 * Fix prettier issue. * Remove breaking changes other than property order changes * Make it pretty again * Added new properties SiteConfig.PublicNetworkAccess and Site.virtualNetworkSubnetId to enable azure policy * Fix prettier and spellcheck issue * Fix spellcheck issue * Add virtualNetworkSubnetId prperty to Site objec tmodel Co-authored-by: Naveed Aziz * Add Reading Order parameter to Computer Vision 3.2 Read Operation (#14204) * Fix CI for EG data-plane (#14171) * Fix CI for EG data-plane * Update readme.md * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2021-01-01 (#14130) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-12-01 to version 2021-01-01 * Updates readme * Updates API version in new specs and examples * Adding user data fl… * Adding xms-identifiers for Agrifood (#17574) * Adding xms-identifiers for Agrifood * removing changes on non-resource-manager files * Adding x-ms-identifiers for AnalysisServices (#17576) * Adding x-ms-identifiers for AnalysisServices * revert changes related to files outside resource-manager * Add x-ms-identifiers for AddOns (#17567) * adding xmsidentifiers for addons * prettifying * remove added properties * add xms-ids for logz (#17652) * [OperationalInsights] Workspace provisioningState was set to readOnly (#17379) * [aks] fix vm size model and osDiskType description (#13763) * fix: agent pool vm size should be string, not enum * fix: osDiskType default description for >= 2020-11-01 * [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-03-01-preview (#13267) * init * fix format * sync * read only * fix sample * fix Co-authored-by: Teng Pan * storagesync readme t2 config (#13810) * storagesync readme t2 config * storagesync readme.python t2 config * Updated SAS swagger with latest changes. (#13439) * Fixed hostname in the Offazure swaggers. * added newest swagger from service repo. This contains PE changes too. * rewritten swagger changes on existing swagger * some fixes to swagger * added examples. * fixes * edit * edit. * fixes * minor fix * edit * edit * edited default api version tag * Dev weather microsoft.maps 1.0 (#13796) * Remove preview from Weather API, remove X-Publish, and convert X-ms-enum ModelAsString to true * Revert changes to package-lock.json * Fix spelling error * Adding Azure Object Anchors error codes for IngestionProperties (#13787) * Added Azure Object Anchors error code field to IngestionProperties * Fixed spacing in example * Moved changes to new version * Addressed version mismatch, spacing * Fixed versions on examples * Readonly error code * Seeing if readonly error code is breaking * Revert "Seeing if readonly error code is breaking" This reverts commit c0b16f07c4a46a07fc7831a1735bb290804242ea. * Model error code as string * Renamed examples to asset conversion nomenclature * Fixed rename issues * Fixed issue #9593 (#13262) * Fixed issue #9593 * Removed redundant PrivateEndpointConnectionProperties attribute * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-05-01 (#13800) * Fixed Swagger Validation Errors * Fixed Model Validation * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 (#13788) * Fixed Swagger Validation Errors * Fixed Type * Fixed Type * Fixed Setting Properties * Fixed Punctuation * Removed Item * Added Items Properties * Fixed Required Property * azurestack wave4 t2 config (#13813) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. (#13490) * Added Microsoft.AppConfiguration 2021-03-01-preview API version. * Add system metadata to tracked resources in "Microsoft.AppConfiguration". Updated ConfigurationStore to reference the common tracked resource type definition. * Added disableLocalAuth property. * Add new api version swagger to readme. * Added/updated examples and added suppressions for standardized APIs. * Fixed prettier. * Add missing property fileStorageSkuName into MySQL Flexible Server spec (#13693) * appplatform t2 readme config (#13829) * customproviders t2 readme config (#13831) * Update readme.csharp.md (#13807) * [Sentine][Data connectors][Fix correctness bug] (#13175) * update required fields * update required fields * Explicitly define KeyCreationTime in Feb21 (#13757) * Explicitly define KeyCreationTime Explicitly define KeyCreationTime * Fix KeyCreationTime Example Fix KeyCreationTime Example * Add Microsoft.M365SecurityAndCompliance RP (#13646) * Add Microsoft.M365SecurityAndCompliance RP * fix datetime and common-types file path * update common-types file path * add preview path in readmego * replace stable with preview * remove duplicate tags * refer MIPPolicySync json in readme * service name for java (#13837) * Dev keyvault microsoft.key vault 2021 04 01 preview (#13585) * Adds base for updating Microsoft.KeyVault from version preview/2020-04-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Open API change for Managed Hsm private endpoints feature (#12938) * Open API change for Managed Hsm private endpoints feature * Fixing spell check errors * Fixing spell check errors * Prettier fixes * Fixing swagger validation errors * Fixing systemData property reference * Adding publicNetworkAccess property based on private endpoint requirement. * GET responses following a successful DELETE should be returning 404. … (#13054) * GET responses following a successful DELETE should be returning 404. Only the DELETE response is to return 204 if the resource didn't exist (it allows idempotent deletes). (cherry picked from commit b752a19c6cc1f8a8eed9f106e2c77b8d5b5db19f) * Removing 404 as it is taken care by default response. * Added new routes for Deleted ManagedHsm for Soft Delete Feature (#13282) * Added new routes for Deleted ManagedHsm and examples, updated ManagedHsm definition to include PurgeDateTimeUTC * Fixing validation issues. * Fixing errors in properties in example jsons * Delete keyvault.json Deleted an errant json file * Fixed misspelling of property in examples * Fixed x-ms-examples naming, fixed camelcasing * Addressing comments in PR to make 204s 404s and also changing PurgeDateTimeUTC to scheduledPurgeDate * Added schema definitions for 404 * Removed 200 for purge Co-authored-by: Soohwan Kim * Addressing Comments for PR 13585 (#13586) * Removed 404s to allow requests to fall through to default * Removing 404s from examples Co-authored-by: Soohwan Kim * Added deletedmanagedhsm object to examples and managedhsm.json (#13591) * Added deletedmanagedhsm object to examples and managedhsm.json * Fixing error in references to correct values * Changed vaultId to mhsmId in exmaples Co-authored-by: Soohwan Kim * Try to use the common type for SystemData (#13723) * Add SystemData property for KeyVault * 04012021 fix schema (#13749) * Resolving conflict with custom-words.txt * Add 2021 preview to azureresourcechema, add suppression to readme * Add 2021 preview to azureresourcechema * Merging custom-words.txt Co-authored-by: Soohwan Kim * Add missing default error response (#13762) * Fix Lint error (#13765) * Add missing default error response * Update the integer format to fix Lint error * Add securityDefinitions * Added python tag for 2021 preview (#13805) Co-authored-by: Soohwan Kim * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (#13822) * Fixing linting errors for MHSM R4036 - ImplementPrivateEndpointAPIs (cherry picked from commit c1c5aebfb98cacd0a4ee5596fb7b0d9f782a9a3e) * prettier fix * Add suppression for SystemData (#13835) * Add suppression for SystemData * Fix linting error R4036 - ImplementPrivateEndpointAPIs * specify the suppression for SystemData * Revert "specify the suppression for SystemData" This reverts commit cbebab81ab08ec1a29b41c891c58cf08ff2eb3c4. Co-authored-by: jiacheng-L <71623842+jiacheng-L@users.noreply.github.com> Co-authored-by: kim-soohwan <40476315+kim-soohwan@users.noreply.github.com> Co-authored-by: Soohwan Kim Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> * hybridnetwork only track2 configure (#13832) * hybridnetwork only track2 configure * remodify * namespace del Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * terraform readme for alertsmanagement (#13744) Co-authored-by: Your Name * add tags back in the adp readme (#13850) * Add device principal type (#13799) * copy files from previous version * add device principal type, update versions * fix * system data requirement * Added CheckNameAvailability, Identity, systemData, used ErrorResponse v2 in DeviceUpdate (#13750) * Update deviceupdate.json * Update deviceupdate.json * Add files via upload * Update deviceupdate.json * Update deviceupdate.json * Update Accounts_Update.json * Update Accounts_Create.json * Update Instances_Create.json * Update deviceupdate.json * Linux line ending * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update CheckNameAvailability_AlreadyExists.json * Update CheckNameAvailability_Available.json * Update deviceupdate.json * Update deviceupdate.json * fixed typo in the example files (#13764) * Update CODEOWNERS (#13795) Updating list of Azure Cognitive Search team members * Update GenerateDetailedCostReportBySubscriptionAndTimePeriod.json (#13772) Update example data * [Hub Generated] Public private branch 'stuartko/Mar21_NewTSVersion' (#13811) * Adding version 2021-03-01-preview (copy of previous version) * Adding new metadata property * Adding uiDefinition property. * Update uiDefinition name to uiFormDefinition (per a change by the service feature author). No change to functionality. * Template Specs: Renaming template to "mainTemplate" and changing "artifacts" to be more specific "linkedTemplates". * Swagger changes for 2021-02-01-preview api version (#13794) * Copy existing preview version * Changes to databoxedge json file * Update readme files * Correct Spell Check * Fix Readme.go error * Update examples * Update all schemas.md files (#13862) * typo: implmentation -> implementation (#13644) * Add MongoDB/MongoDBAtlas sink (#13669) * Add MongoDB/MongoDBAtlas sink, add disableMetricsCollection in read/wirte properties * Revert disableMetricsCollection related changes * Azure ML new API version 20210401 (#12981) * Add Identity to createWorkpace example * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * change for getTransitivePEUsages * update * prettier code * add another new endpoint * address comments * revert change on transitivePE and notebookKeys * revert change on transitivePE and notebookKeys * add new stable version 2021-01-01 * add ListNotebookAccessToken * add primaryUserAssignedIdentity * fix missing properties and apis * fix one more missing property * 202 status for start and stop CI * make resync keys long runnin operation in version Jan2021 * resync keys 204 * update resync keys example * Dont throw 204 for resync * update resync keys * Formatting * revert Jan2021changes and add new version * start apr2021 version for azure ml rp * undo remove new line in jan2021 * use systemData definition in common * removed old files * fix small swagger bugs * run prettier * remove reference to sku * update readme * minimum agentCount should be 0 * add createdOn and ModifiedOn to compute properties * add LoadBalancerType to aks compute * add isNotebookInstanceCompute to virtualMachine * add leafDomainLabel to SslConfiguration * add overwriteExistingDomain to SslConfiguration * add synapseSpark as supported compute-type * update patch compute response to 202 * remove location from example responses * Revert "remove location from example responses" This reverts commit 048bf2551513afae842a9c4fbb5861aeddc6c33a. * MachineLearningCompute_Update should have a 200 response * sys data to use local def due to naming conflicts. * Fix enum casing * Fix operationId PR comment. * Change opId in apr version * remove 20210401 for easy review * only change api version * merge changes for 20210401 version * Add x-ms-discriminator-value for Synapse spark * camelcase loadbalancer properties * add createdOn and Modified on to examples * address AvoidAnonymousTypes error for SynapseSpark * Minor fixes + new property * Remove subscription state. Co-authored-by: zhaomuzhi Co-authored-by: Vinay Rajmal Soni Co-authored-by: jopet@microsoft.com Co-authored-by: Josh Peterson <15050193+joshanator@users.noreply.github.com> * datashare readme t2 config (#13833) * add readme terraform (#13717) * adding a new API version for Restore API and adding targetVirtualMachineId field for AzureWorkloadRestoreRequest (#13638) * copying previous change * Adding targetVirtualMachineId field for Azure Workload Restore requests * updating crr version and examples * removing new api-version * adding back the new api-version * removing Snapshot related fields * updating readme.md * corrected the path Co-authored-by: Chandrika Gonuguntla * chore: resort custom-words.txt from bad merge (#13868) * [ApplicationInsights] Fix failure for python SDK (#13875) * [Hub Generated] Review request for Microsoft.Insights to add version preview/2020-10-05-preview (#13712) * Adjustments to API to include validation grouping and updated text. * Fixed missing curly brace * adjusted name * Added basic and standard examples * adjusted type. * corrected case for key value * [Hub Generated] Review request for Microsoft.Insights to add version preview/2021-03-03-preview (#13269) * Adds base for updating Microsoft.Insights from version preview/2020-10-05-preview to version 2021-03-03-preview * Updates readme * Updates API version in new specs and examples * Add DiagnosticServiceToken API * Update examples to split tokens for readonly vs readwrite * Fix accoding to code review feedback * Update examples due to review feedback from ARM * add configuration for vmware (#13879) Co-authored-by: Your Name * keyvault t2 config (#13863) * keyvault t2 config * keyvault multi-api config * multi api config * config reset * add package version * hanaonazure t2 readme config (#13880) * Remove x-ms-azure-resource (#13500) Co-authored-by: Dongwei Wang * Juniwang/sr202010401preview (#13664) * prepare to add new api-version: copy everything from 2020-07-01-preview * Adding new api-version * Fix required body and annotate ms secrets * remove secrets example from swagger * fix prettier * add datashare terraform configuration (#13876) Co-authored-by: Your Name * storage readme t2 config (#13881) * storage readme t2 config * storage t2 config * healthcareapis t2 config (#13884) * typo: APIkeys -> APIKeys (#13641) * Allow release_policy to be nullable (#13826) * Fix type of Anserws and Captions (#13872) * change the value of license header (#13886) * [Synapse] - library_append API adds comp parameter (#13841) * [Synapse] - add comp parameter * Update example files Co-authored-by: Dongwei Wang * Remove 200 response from async operation (#13190) * Async operation always returns 202 on initial call * Address review feedback * Revert "Address review feedback" This reverts commit 9ae550b95c1082c8383595a943a9abe5990fd4ef. * add minimal tls version for mariadb (#11779) * [Synapse] - add Swagger code owner (#13882) Co-authored-by: Dongwei Wang * add con figuration for databoxedge (#13877) Co-authored-by: Your Name * add configuration for resourcemover (#13878) Co-authored-by: Your Name * Reduce code owner scope for Monitor.Exporters team (#13898) * [portal]Update readme.python.md (#13907) * Update readme.python.md * Update readme.md * Update readme.python.md * Update readme.python.md * Dev dfp microsoft.dfp 2021 02 01 privatepreview (#13305) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * DFP API specs. Copied from Azure-PPE * Spelling fix. instnace => instance * Fix resource provider name to pascal case * Added '/providers/Microsoft.Dfp/operations' * Added SystemData (fix R4009 error) * Fix validation errors * Prettier fixes * Removed non-existend parameter sku * Style fixes in DFP API specs * Swagger ModelValidation failures fix * Fix operations API * Fix operations API validation failure * 1. Added example for lists operations. 2. made the API preview instead of privatepreview * Fix path in readme's * Fix in readme * Added readonly attribute to systemdata * Added readonly attribute to systemdata * Fix in python SDK readme * Fixes in ListOperations.json examples * Fixed API version * Added type to response bodies * Fix typos in examples (urls) * Added 201 response into createInstance example * Renamed RP name from Microsoft.Dfp to Microsoft.Dynamics365Fraudprotection * Added long-running result for creation instance * Added nextlink * Fix in checkNameAvailability definition URL * Next link parameter * Using references to common types instead of re-declaring them * Reused common type. Fixed provisioning state * Nesting error fix * Fixed examples * Fix * Fix in error response definition * Rename RP. Fix examples in readme's * Added http 202 * Added http 202 to examples * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-10-01 (#13818) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-09-01 to version 2020-10-01 * Updates readme * Updates API version in new specs and examples * Adding new fields for 2020-10-01 * Updating wording for disablePasswordAuthentication' Co-authored-by: jmccarthy * Remove name check from client side (#13492) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * Update deviceupdate.json (#13900) * [Hub Generated] Review request for Microsoft.ResourceHealth to add version stable/2018-07-01 (#13817) * Updated api-version * Removed systemData * Updated api-version * Updated the example * Add EligibleChildResources resource for PIM + update examples (#13803) * PIM API Specs * update readme * Update * Update readme * operation id fix * name fix * Name changes * fix * Fix * Changes based on docs generated * Scope fix in example * Updates for documentation * Change operation name * Update examples * Add expanded properties * Fix formatting * Fixes * Fix * fixes * Update the policy specs * Fix the policy objects and pell checks * fix the checks * fix the property * fix syntax * Prettier * Update Examples * Update Enums * ADd eligible child resource API specs * prettier fix * Update read me files * update * update * fix * update * Update Enums * update * update * update * update example Co-authored-by: Aman Swaika Co-authored-by: Gaurav Mishra (IDENTITY) * refine readme.go.md (#13906) Co-authored-by: Your Name * [Service Fabric Managed Clusters] adding api version 2020-05-01 (#13860) * initial commit 2021-05-01 to compare with previous version 2021-01-01-preview * update models * update examples * fix isStateless description * add 2021-05-01 version to readme * add x-ms-enum to diskType and add missing managedClsuterVersions paths fix example names add managed cluster version paths add default error * fix clusterversion by version and ClusterState descriptions Co-authored-by: Alfredo Santamaria Gomez * Task 9639284: Swagger changes for new UK agreement templates (#13895) * Task 9639284: Swagger changes for new UK agreement templates * Renamed as per comments. Co-authored-by: Umang Shah * Confluent new preview version + S360 fix (#13809) * Adding new API version for Microsoft.Confluent * Prettier fix * updated status property in OfferDetail updated status property in OfferDetail to fix swagger correctness issue * fix swagger live validation updated operations response to fix swagger live validation Co-authored-by: Srinivas * [Hub Generated] Public private branch 'juniwang/wps' (#13905) * Onboarding Azure WebPubSub service * reference ErrorResponse from common types and adding network ACL * disable cors, enable feature flags and fix several policy violations * remove anonymousConnectPolicy since it's not ready for now * add property publicNetworkAccess per NRP requirement * revert package-lock.json * reset package-lock.json * dns t2 readme config (#13923) * update readme (#13918) * add current readmes for generating python form recognizer (#12013) * add current readmes for python form recognizer * fix release tag * updates for multiapi and preview.3 * fix so that gen code outputs in generated folder * remove tag since swagger not in yet * unbreak build * just target preview 3 * don't run track 1 gen with python * Set x-ms-api-version to false for vaults list (#13924) * Set x-ms-api-version to false for vaults list (#13925) * Update event description to include the event name (#13867) * Update event description to include the event name * Update readme to include guidelines for defining a new event * Fix description * Renamed enum values for SDK auto generation (#13938) * Renamed enum values for SDK auto generation * Tabs to spaces * Newline added * [Document Translator] update operation names (#13915) * update operation names * make body required * Update ErrorName * Apply changes to stable * Fix samples * fix sample * Fix glossary sample * Address comments and update definitions names * Revert "Task 9639284: Swagger changes for new UK agreement templates (#13895)" (#13946) This reverts commit ea5bc27ee9cadeb67767d774c82095be2420bcad. * Adding new preview API for promotions (#11599) * Adding new preview API for promotions * Avacado fix * Fixing JSON * fixing the promo param * fixning linting issues * Fixing JSON * fixing JSON * fixing linting issues * Adding delete 204a * Adding delete 204 * Adding validation fixes * fixing spellings * Linting issues * running prettier * ARM review feedback * Fixing linting issues * Fixing prettier * Fixing version * Fixing SDK * fixing go sdk * revert go.md Co-authored-by: Rishi Kapoor * Exposing undocumented Databricks workspace properties for fixing S360 issues (#13683) * exposing storage account name, sku * Prettier fixes * Fixing the review comment * Adding No Public IP related properties * Updating the remaining properties related to S360 * Fixing review comments * Fixing Spell Check issue * hybridcompute readme t2 config (#13910) * readme t2 config * hybridcompute t2 readme config * web readme t2 config (#13909) * web readme t2 config * web readme.python t2 config * Add x-ms-api-version (#13834) * Update CheckNameAvailability_Available.json (#13914) * webpubsub t2 config (#13949) * Update StaticSite.json (#13768) * Update StaticSite.json Add private endpoint connections to static site object. * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * Update StaticSites.json * increment readme version * address PR comments * add examples * fix examples * Add data-plane samples creation template (#13528) * Add data-plane samples * Simplified template * webpubsub readme t1 del (#13953) * Add $(multiapi) to QnA Maker's readme.md (#13819) Generators were processing every tag when only a single one was desired. This is the common solution to support multi-api SDKs. * IoT data-plane for drwill-ms (#13964) * add missing usage.json to v5 sdk tag (#13960) * [Hub Generated] Review request for Microsoft.Kusto to add version stable/2021-01-01 (#13306) * Add new api version 2021 * remove managedIdentity since we won't support it in this version * CR comments * Add default value for contine on errros * Fix swagger correctness issues * Fix typo * resource t2 readme config (#13974) * Added new API and API version for private DNS zone suffix (#13789) * Added new API and API version for private DNS zone suffix * trigger validation pipelines * Add new API to readme * Fix ARM pipelines * Try fix again * Fix again * Add Operations API * Revert "Add Operations API" This reverts commit 9d4ca9e557763feb3a6089ff9d4c958b3843730e. * Revert "Revert "Add Operations API"" This reverts commit 7cf197c1d453764f0396713a2ab172a20e35b1c4. * Revert "Revert "Revert "Add Operations API""" This reverts commit 05744390e440984da8134b64a979a6e61fb9b7ae. * Revert "Revert "Revert "Revert "Add Operations API"""" This reverts commit 61b76b1623d9e5796bb8187edf0fc46351e78231. * Revert "Revert "Revert "Revert "Revert "Add Operations API""""" This reverts commit 9f55eb4c399eb48a8578906f6bea43b10c91b8be. * Address review comment from ARM * Revert "Address review comment from ARM" This reverts commit cb6d1b01860de72eec80856f64b602c72a1f26a7. * Revert "Revert "Address review comment from ARM"" This reverts commit 227cf73797ee24a674d76e3ccd2990b84bc8d11a. * Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API"""""" This reverts commit 34ae6c70a514e0290ffb41f7ddb5bbbd5c6cbee3. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Add Operations API""""""" This reverts commit a11c889a65b0fa4257b03a247d75fbea769f4e2c. * Add previous APIs to tag * Retrigger build * fix service name for Java (#13979) * Add optional param - private DNS zone to server API (#13716) * Add optional param - private DNS zone to server API * Follow comment to resolve go sdk issue. * [Hub Generated] Review request for Microsoft.Synapse to add version preview/2021-04-01-preview (#13874) * Adds base for updating Microsoft.Synapse from version stable/2021-03-01 to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * add changed files for kustoPool * Ravi changes to fix LinDiff validation * Add Itay Sofer's changes * filizt comments mid-way * Remove clouderror and resplace with "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" * Add IotHubDataConnection and EventGridDataConnection * Modify PUT to OK, CREATED, ACCEPTED * Change from provisioningState to ResourceProvisioningState * Add BlobStorageEventType * Remove 202 when creating a KustoPool * Change PUT/PATCH 202 responses * Remove 202 in PATCH/PUT operations where having both 200 & 201 * Add "isIdentityCertExprired" to custom-words.txt * Remove isIdentityCertExprired from custom-words.txt * Add Exprired to cSpell.json Co-authored-by: Amit Elran * Removing x-ms-flatten property (#13929) * manual changes for swagger * changes for long-running operations * changes for validate for backup and restore * removing 204 from operationResults * changes for a monitoring * adding format * removing date-time from duration * changing to readonly * changes for listRPs * fixes swagger * reverting readonly for scheduleTimes * fixes for checkgates * prettier fixes * cahnges for friendlyname checks * fixing gates * removing tracking-via * model validation fixes * powershell changes * adding stable version * changes for PatchResourceRequestInput * change for req fields * changes for description * changes * Updated swagger json for item level restore target info objects * Fixed spelling errors * Added missing required properties * removed auth credentials property * prettier fixes * Prettier fix * pr comments fixes * fixing readme * changes for go readme * Removed x-ms-flatten property (#2) * removed flatten prop * removing x-ms-flatten * removing friendlyName from req prop Co-authored-by: Mayank Aggarwal Co-authored-by: Mayank Aggarwal Co-authored-by: FAREAST\zakinkh * confidentialledger readme t2 config (#13981) * Additional 7.3-preview parameter name clean up (#13913) * Enable multivariate anomaly detection (#13973) * add multivarite * add v1.1-preview * reformat changepoint example * change typo in readme * fix prettier-check error * add export model example * fix prettier error * [Azure Search] Add Knowledge Store feature to swagger (#13911) * introduce knowledge store swagger * add knowledge store to 2020 apis Co-authored-by: Austin Drefke * make skillset count optional, and add it to 2020 GA Swagger (#13990) Co-authored-by: Austin Drefke * Adding support for message properties in ACS Chat (#13939) * Initial commit (copying over stable API version) * Making changes to support message metadata * Added 201 response code for patch operation (#13956) Co-authored-by: Akash Keshari * Adding autoMitigate flag with false as default value (#13109) * deploymentmanager - clean up duplicate parameters outside of method (#13948) * clean up duplicate parameters outside of method * maintain python order * fix typo in Synapse (#13994) * OperationalInsights - update readme files for cli extension update (#13999) * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * added Tables new api version * changed bool to boolean types * prettified jsons * fix erroes in swagger * undo changes to 2020-03-01-preview version * pr fixes * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * changed ErrorResponse to default ErrorResponse without ref to local definition * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed SystemData * creatted a new package containing all latest swagger files for publishing new SDK * removed package 2021_02 and set default packate to 2020_10 * removed 2 packages * removed DataCollectorLogs.json from readme.md 20202.10 * added empty line to try invoke pipeline validations that havent run * Delete Tables.json * added3 new properties to TableProperties: IsTroubleshootingAllowed, IsTroubleshootingEnabled, IsTroubleshootingEnabledLastActivation. * merge * prettified jsons * undo changes to 2020-03-01-preview version * updated TableUpdate example * changed lastTroubleshootDate from date format to string, removed isTroubleshootingAllowed from body of example * changed v1 to v2 * changed WorkspaceNameParameter back to V1 * added systemData * removed systemData * added systemData to Patch and Get * moved systemData to Table properties * deleted systemData from Table.json, added to Get and Put examles * changed location of systemData in Tables.json * moved systemData to inside Table definition * moved systemData inside Table properties * removed whitespaces * changed DataExportErrorResponse to common .../v2/types.json#/definitions/ErrorResponse * changed all Error response of 2020-08 to common definition * added readme.az.md file for cli extension code generator * added readme.ad.md with the same naming convention as in readme.python.md added readme.cli.md file updatted readme.md file with the new azure-cli-extensions tag all updates were done by following: https://github.com/Azure/autorest.az/blob/9ed1aabd353385f8bdffbfa9f3892478111a029c/doc/how-to-author-readme-file.md * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * Update specification/operationalinsights/resource-manager/readme.az.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * added azure-powershell to readme.md Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> * [Cognitive Services Metrics Advisor] add missing required for allOf entities (#13957) * add missing required for allOf entities * fix incorrect required properties * 7.2-Preview to GA (#13919) * 7.2-Preview to GA * Update packages to point to stable * Readd exportable and update description * Update description for exportable in preview versions * Fix operation results contract for Tenant Git operations (#13903) * fix operation results contract * fix sync state contract * iothub t2 readme config (#13980) * iothub t2 readme config * iothub readme t2 config * iothub t2 readme config * Making Offer details and User Details required properties (#13985) * Making Offer details and User Details required properties and removing abandoned tag * fix python configuration * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * cosmosdb t1 config del (#14008) * Fixing issue with missing filter documentation in Access Review APIs (#13892) * fix cred issue. block to merge in DSMainDev (#14014) * fix serivce name for java (#14007) * maintenance readme t2 config (#13982) * maintenance readme t2 config * readme t1 config * [Service Fabric Managed Clusters] fix api 2020_05_01 (#13961) * Use enums and add missing properties * model enum as string Co-authored-by: Alfredo Santamaria Gomez * [Hub Generated] Review request for Microsoft.BotService to add version stable/2021-03-01 (#13784) * add isIsolated and channelSchemaTransformationVersion * rename * add v2 priavatelinks (#14026) * copied from v1/privatelinks.json * bump version Co-authored-by: jianyexi * APIM: improve developer portal operations docs (#13941) * APIM: improve the documentation for dev portal operations * Minor changes * Removing OData parameters from the stable API version * Remove new query params * hotfix on extended location hierarchy (#13943) * [Hub Generated] Public private branch 'wps' (#14002) * Add webpubsub swagger Add custom words Update webpubsub.json Update webpubsub.json Resolve comments Update webpubsub.json resolve comments Update operationId for existence check [wps] update python generation section and client name for all languages (#1) * add python stuff * make title across languages the same * Update version * Update some constraints * Update webpubsub.json * rename to GetServiceStatus * Update readme.md * Update readme.md * Update readme.md * [Hub Generated] Review request for Microsoft.SecurityInsights to add version preview/2021-03-01-preview (#13563) * Copied from 2019-01-01-preview version * Updated references to common types * Add itemsSearchKey field to Watchlists * Add missing label definition * Make itemsSearchKey as required field * Formatting fixes * Fix Prettier and Avocado errors * Fix Lint error (subscription level resource) * Update description and example for CreateOrUpdate watchlists and bulk create watchlist items * Update Api version in examples * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13888) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * updated default package in readme.md to 2021-03 Co-authored-by: Chandrika Gonuguntla * Updated required and default fields in Action Groups spec (#13677) * Updated error response for Action Groups API * spacing * added missing fields to Action Group Resource spec * Added missing fields for action group resource in older version * Updated "resource" name * Removed changes to errorResponse * Removed errorObject * format * Updated required and default fields in Action groups spec * Update default value to boolean Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * changes default value type to boolean * undo webhook receiver changes Co-authored-by: Ritwik Rajendra Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> * Remove AML Compute File Server (#13944) * Remove AML Compute File Server * update * update * update * update * Cost Management: Reservation Recommendations API: Add multiple missing properties in specs (#13967) * added totalCost, properties.resourceType, properties.subscriptionId, and eTag to various RiRec dfinitions * moving eTag property to right place * remove duplicate description * remove track1 configure (#14044) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * New API version (2021-02-10) for recovery services site recovery (#13525) * Adding old API version(2018-07-10) to new folder for 2021-20-10 * all changes for swagger (2021-02-10) * read me and custom word changes * Ayesha's comments addressed * adress PR comments from ayesha * Adding suppressions * fixing custom words * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13636) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-02-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * Update readme.md changing read me to include date too in tag * cahnging examples API version to 2021-02-10 * fix read me syntax * TaskStepProperties swagger fix (#13971) * Adding "assignmentState" property to scope model in access review APIs (#14039) * iothub readme.python package version change (#14043) * iothub readme.python package version change * multiapiscript add * clear output folder * Update readme.python.md * Update readme.python.md * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Bump y18n from 4.0.0 to 4.0.1 (#13704) Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update (#14061) * package-templatespecs-2021-03-preview tag added (python) (#13958) * Added tag * nit: ordering Co-authored-by: Dania Etienne * Use 2014-04-01 replication link specs in V5 SDK (#14058) * Use 2014-04-01 replication link specs in V5 SDK * remove legacy file. * Update cSpell.json for Key Vault 7.2 (storage) (#14060) * automanage readme t1 del (#14029) * automanage readme t1 del * automanage readme t1 del * readme.md t1 config del * add missing reference (#13904) * databoxedge readme modification (#14063) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * managedservices t2 onfig (#14064) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-02-10 (#13635) * Adds base for updating Microsoft.RecoveryServices from version stable/2021-01-01 to version 2021-02-10 * Updates readme * Updates API version in new specs and examples * fixing merge issue * removing vault usages from 2021-02 * Adding back vault usages * updating readme * updated etag to eTag (#13968) * [Hub Generated] Review request for Microsoft.InstanceMetadataService to add version stable/2020-12-01 (#13931) * Adds base for updating Microsoft.InstanceMetadataService from version stable/2020-10-01 to version 2020-12-01 * Updates readme * Updates API version in new specs and examples * Adding new spot VM fields Co-authored-by: Joshua McCarthy * Add FaceAPI PersonDirectory spec updates to preview v1.0 (#13766) * Add FaceAPI v1.0-preview Add a preview version of FaceAPI specs intended for public preview. Contains existing spec in v1.0 plus PersonDirectory feature changes. * Fixes after running validation * Fixing validation * Fixes 2 * Fixes 3 * Add PersonDirectory examples and fix routes * Fixes 4 * Fixes 5 * Fixes 5.5 Co-authored-by: Yang Chen * Update the name and format of a parameter for randomnumbers (#14017) * Update the name and format of a parameter for randomnumbers * Change the parameter name from 'bytes_length' back to 'bytesLength' * Amalladi/extendedlocation update (#13849) * Updating Specification to remove 400 Badrequest from Swagger File * Removing 400 status code from examples * Removing private preview API version from Repo * Removing 2020-07-15-privatepreview tag from ReadME files Co-authored-by: Aditi * maps t2 config (#14075) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * Revert "remove track1 configure (#14044)" (#14047) This reverts commit 867165cc24d81c487ad186c998c46ba55f81c77b. * adding role assignment (#14077) * add connectionPolicy spec back to V5 SDK (#14088) * modification (#14087) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.DocumentDB to add version preview/2021-04-01-preview (#13710) * Adds base for updating Microsoft.DocumentDB from version preview/2021-03-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * Adding new API for fetching backup information(such as latest restorable timestmap) for a resource. Also, adding startTime,endTime to restorable.json * adding Services APIs * more changes * updated examples * prettier and readme updates * importing changes missed from old versions * nits * fixing semantic validation * fixing linter * fix * more fixes * adding list operation and default error response * specifying format integer * attempt to fix sdks * address arm comments and fix ci * fixes * fix * try to fix ci * fix examples * .\services.json * adding additionalProperties back to ServiceResouce * adding additionalProperties back to ServiceResouce * fix * fix sdks * fix linter Co-authored-by: Meha Kaushik Co-authored-by: Meha Kaushik * media t2 config(wave4) (#14074) * media t2 config * add packageversion Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) * [Hub Generated] Review request for Microsoft.Maps to add version stable/2021-02-01 (#13733) * Adds base for updating Microsoft.Maps from version preview/2020-02-01-preview to version 2020-02-01 * Updates for 2021-02-01 api version swagger * creator swagger fixes * fix model examples * nextLink, uniqueId * build fixes * fixing listkeys * fix long running operations * fixing spelling * fixing async behavior and examples * updating arm region * reset package-lock * [Hub Generated] Review request for Microsoft.Media to add version preview/2021-05-01-preview (#13838) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy Signed off 2021-03-01 swaggers here * Update swaggers to 2021=05-01-preview * add missing examples * update title * fix Operation id * fix video analyzer examples * update Video swagger * add format for $top * remove unnecessary example file * use chackname definitions from types.json * fix segment length readonly * change getStreamingToken to listStreamingToken, getProvisioningToken to listProvisioningToken * fix the example file name * fix a readonly issue with a video property * make type readonly * edits to descriptions * adding missing descriptions * address review feedback, * few cleanup for update class Co-authored-by: Christopher Bennage * Include the preview version of resource changes and resources history… (#14084) * Include the preview version of resource changes and resources history APIs * Address the review feedback on releasing the new package version. * Update readme for Synapse management SDK May release (#14054) * Update readme for Synapse management SDK May release * Add package-2021-05-preview * Address comment Co-authored-by: Dongwei Wang * removing read only property, no longer in use - NOT a breaking change (#13812) * resources readme.python t2 config (#14091) * peering readme t2 config (#14106) * Remove replicationLinks_legacy.json (#14095) PR #14058 removed this file: replicationLinks_legacy.json, removing from the schema config to prevent schema generation failures. * Support sheet index in excel (#14062) * Enable excel in public swagger * update * rollback dataflow change * Support sheet index in excel Co-authored-by: zhanyu2014 * Adding 2021-05-01 api-version to Template Specs (no changes over last preview spec) (#14065) * Copy existing 2021-03-01-preview specs to new 2021-05-01 stable version (no schema changes) * Changing api-version within specs to 2021-05-01 * Adding package tag for new stable version to readme.md, but not making it a default (yet) * Fix SecurityInsights Go SDK versioning (#14030) * Fix SecurityInsights Go SDK versioning * rename stable api version tag * remove 'only' from tags with full functionality * chore: Move typo supression in RecoveryServices (#14120) * Add missing Zone mapping property to Microsoft.Resources (#13936) * remove name validation from client side * remove name check from deploymentScripts swagger * remove name check from previous swagger versions * remove pattern from resourcegroupname parameter * add zoneMappings to ResoursesType * backfill older versions of swagger with zonemapping property * [Application Insights] Resolve duplicated definition names to fix track2 SDK generation error (#13951) * Fix duplicate name * Update readme.md * Update readme.md * Update and rename workbookOperations_API.json to aiOperations_API.json * Update readme.md * Update workbooks_API.json * Update readme.md * Update readme.python.md * Update readme.md * Update readme.md * Update readme.md * Rename aiOperations_API.json to workbookOperations_API.json * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update readme.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update specification/applicationinsights/resource-manager/readme.python.md * Update swagger for SSIS-IR to support user-assigned managed identity (#14114) Co-authored-by: Hongxian Yao * postgresql readme t2 config (#14067) * Dev mediaservices microsoft.media 2021 05 01 (#13676) * Adds base for updating Microsoft.Media from version stable/2020-05-01 to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * [AMS] new 2021-05-01 release for Account service in AMS * add missing example files * fix the api version and missing example files * Create a new Update definition to fix the "R2016 - PatchBodyParametersSchema " * fix respnse * fix update example * add the 2016 supression for new tag as well. * mixedreality t2 readme config(wave4) (#14105) * mixedreality t2 readme config * t2 config del * [python] t2-confidentialledger config (#14144) * Update readme.python.md * Update readme.python.md * Update readme.python.md (#14145) * update elastic swagger (#14076) * Update elastic.json * added new examples * taking the files from rpsaas master * added suppression in readme * [Cosmos DB] Introduce new api version 2021-04-15 (#13873) * [Cosmos DB] Introduce new api version 2021-04-15 Initial Commit * Updated for 2021-04-15 * Dummy Commit * Fixing privatelinkresources.json * Removing ErrorResponseUpdatedFormat * Suppressing systemData check * Relay - Fix typo in the NetworkRuleSet path (#13962) * Relay - Fix typo in the NetworkRuleSet path * Suppression - DefaultErrorResponseSchema - we will be Implementing in new API version * [Hub Generated] Review request for Microsoft.Portal to add version preview/2015-08-01-preview (#12732) * Fixing properties in dashboard parts * Updating Dashboard part metadata * Updating based on prettier fixes Co-authored-by: Himanshu Chandel * resources t1 config add (#14146) * t1 config add * package version * [Hub Generated] Public private branch 'dev-maintenance-Microsoft.Maintenance-2021-05-01' (#14148) * Adds base for updating Microsoft.Maintenance from version preview/2020-07-01-preview to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * Added system data properties. * Fixed lint error. Added documentation. * Use Host Maintenance scope and api version in exmaple. Co-authored-by: Kalpesh Chavan * Add Test Base Swagger Spec from RPSaaSMaster (#14113) Co-authored-by: Bin Yu * rename property: change category to categories (#13883) * Edit description of Update Iot Hub Resource Api (#13080) Co-authored-by: Harini * [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-03-01 (#13889) * Adds base for updating Microsoft.RecoveryServices from version stable/2018-07-10 to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Update webpubsub.json (#14096) * add dataFeedId in AnomalyResult and IncidentResult (#14127) * add dataFeedId in AnomalyResult and IncidentResult * fix examples * Add new version 2021-03-31-preview1 for ACS Auth (#13965) * Add new version 2021-03-31-preview * Set required body * Add all paths to new version * Update description for property of TeamsAccessTokenRequest model * Change version from 2021-03-31-preview to 2021-03-31-preview1 following standards https://skype.visualstudio.com/SPOOL/_wiki/wikis/SPOOL.wiki/16790/Versioning * Rename folder * Update method description * remove Turn endpoint * Add examples * Update readme * Omit the word "skypetoken" from swagger * Link example * Update description and path for a new endpoint Co-authored-by: Alexandra Lamiova Pistrakova * Added example gneration document links (#14151) * purview scanning service (#14021) * purview scanning service * Add custom words for spellcheck * fix config files and add endpoint param Co-authored-by: Parv Saxena Co-authored-by: iscai-msft * MG RP new API versions: 2020-10-01 and 2021-04-01 (#13897) * API 2020-10-01 with 2020-05-01 files * 2020-10-01 API changes * 2021-04-01 API version with 2020-10-01 files * Changes for 2021-04-01 API * PR fixes * Fixed issues with model * PR fixes * Latest (#13917) * Pick up previous Swagger Fix in 2019-09-01 version (#14092) * Add missing swagger fix * Fix bad copy-paste * update the some capitalized words in the description * Adding EventData schema for Microsoft.Storage.BlobTierChanged event (#14049) * Adding EventData schema for Microsoft.Storage.BlobTierChanged event * Removing contentLength/Offset from Microsoft.Storage.BlobTierChanged data schema * Removing BlobTierInfo from BlobTierChanged and adding new event Microsoft.Storage.AsyncOperationInitiated * adding ContentLength for BlobTierChanged and AsyncOperationInitiated events * [Hub Generated] Review request for VideoAnalyzer.Edge to add version preview/1.0.0 (#13682) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy old LVA swaggers * Rename old swaggers to new file names * Update LVA swaggers with new AVA swagger * fixed some paths and capitalization * fix prettier check issues * fixing a Pascal casing * Updating swaggers to latest * fix linting issue * removed an unused definition * Service fabric Client API 8.0 (#14011) * spell checked and linted. * updated tag version. * reverted change outside of SF folder. * updated version in swagger. * changed credential issues. * changed 1 more that looks like a credential. * Kusto pools principal assignment (#14079) * kustoPool PrincipalAssignments * fixed list principal assignments * principalAssignment list example * principalAssignment get example * KustoPoolPrincipalAssignmentsCreateOrUpdate * KustoPoolPrincipalAssignmentsDelete * databases PrincipalAssignments * minor change * KustoPoolDatabasePrincipalAssignmentsList * KustoDatabasePrincipalAssignmentsGet * KustoPoolDatabasePrincipalAssignmentsCreateOrUpdate * KustoPoolDatabasePrincipalAssignmentsDelete * fixed example ref * added system data * kustoPoolCheckNameAvailability * KustoPoolsCheckNameAvailability example Co-authored-by: Itay Sofer * [Service Fabric Managed Clusters] fix api 2021_01_01-preview (#14012) * Update preview api to disable broken properties and to add property that is working * Update managed cluster description * Add New Data Model RuleCollection to NetworkManager (#13827) * Add New Data Model RuleCollection to NetworkManager * fix typo * test * test * Fix discriminator * fix type * Fix discriminator * Fix type * fix type * Fix type * Fix discriminator * Fix discriminator * fix type * fix type * Fix bug * Fix type * Fix format * Fix name * Fix name * fix spell * fix description * Fix spell * change to kind * fix lint * fix lint * fix lint * fix lint * fix lint * fix lint * Fix post body * Fix as comments * fix bug * fix bug * fix bug * fix bug * fix bug * fix bug * change rule kind * Fix as comments * Fix as comments * update lastest version * Update type * Update Skiptoken * Fix discription * Fix NG * Fix NG * add more example * [python]Update readme.python.md for postgresql (#14182) * Update readme.python.md * Update readme.python.md * Remove all schema readme (#13885) * Remove all schema readme * process new rp * Remove after_scripts * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2021-04-01 (#13890) * Adds base for updating Microsoft.AlertsManagement from version stable/2019-06-01 to version 2021-04-01 * Updates readme * Updates API version in new specs and examples * first commit * some fixes * try without alert management * revert change to name of namespace * Resolve lintdiff issues * remove the copy of files and reference alert managment previous version * update description of subscriptionId to solve error * attemp to remove AlertsManagement from the package * revert (put back AlertsManagment) * add tags for go SDK release v54.0.0 (#14161) * add tags for go SDK release v54.0.0 * add a new tag * FRv2.1 GA Stable Release (#13997) * Standardized Errors, sample list. * removing from master from now as this is just a proposal * FRv2.1 GA Initial commit. Co-authored-by: Sandeep Parab * remove extra / from host template (#14176) * [Hub Generated] Review request for Microsoft.Batch to add version stable/2020-09-01.12.0 (#14170) * [Batch] Update RemoveNodes description to include max nodes/request * Added suppressions to readme * Update swagger for a new version 2021-03-31-preview1 for ACS Auth (#14168) * Unify names * Update tag * Update due to review meeting * update example description Co-authored-by: Alexandra Lamiova Pistrakova * Add new 1.0 version for IoT Central API (#13713) * Add new 1.0.0 version for IoT Central API * fix swagger style * fix wrong json file name * remove unused examples * revert back email format * remove non-used examples * update with latest examples * update preview from 2019-10-28-preview to 2021-04-30-preview * remove extra --- * update version from 1.0.0 to 1.0 * rollback collections for common entities * update _id to Id, update _name to Name from operation, add sdk generation * fix go sdk file * remove go sdk * updatedevicve_templateId to deviceTemplateId * Add query parameter based versioning, remove resource schema * fix example docs reference * fix typo in comments * renaming execute to run for command operations * add api-version to samples files, fix devices_update missining issue * add devices_update.json for 1.0 * fix rerun_id, add missing parameters to examples for preview, fix command comments from execute to run * fix annoymous type issues * add title to readme. (#14179) * videoanalyzers-fix-missing-host (#14181) * New API version for Microsoft.Resources stable/2021-04-01 (#14132) * base for Microsoft.Resources 2021-04-01 * update readme * update api version * API changes for S2S * readme Co-authored-by: Wendy Chang * Swagger Changes for Get Recoverable Servers and create server with Geo-Restore. (#14013) * Added Recoverable Servers API and GeoRestore API. * Fixed spell check and prettier * Fixed readme.md file issue and changed the postgreSQL to restore. * Fixed duplicate schema issue. * Fixed the mismatch with namespace names. * change the tag name from georestore to servers * Fixed the SDK validation issues. * Fixed objects w.r.t preview version * Fixed operation required properties. * Included 2020-04-10 in the SDK versions * Change the folder path. * Add missing multiapi entry for go sdk v54.0.0 release (#14200) * add missing multiapi entry * fix one output-folder * Azure security insights - add data connectors preview version (#13998) * add new API * ad name to enum * updatre defenition names * update readme * update readme * update readme path files * fix errors * add missing connectors * execute validation * execute pre * update readme * add description ans x-ms-enum * update description * update properties * add description * rename enum - fix new error that didnt display until now * rename enum unser x-ms-enum property * [Hub Generated] Review request for Microsoft.Maps/Alias to add version preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0, preview/2.0 and preview/2.0 (#13921) * Copy Creator API 1.0 to 2.0 * draft of planB * adding ontology properties; adding DataUpload * updated alias apis * put v1 API back so diffing is easier * reapplying v2 so diffs are easier * remove type from datasetsources * incorporate suggestions from review board * adding ontology field * Update alias v2 apis. * fix conversion descriptions, update alias * Fix the alias file. * Add get details example. * fix casing on headers; mapData more consistent * minor comment and linting fixes * Adds base for updating Microsoft.Maps/Alias from version preview/1.0 to version 2.0 * Updates readme * Updates API version in new specs and examples * Add baseline from preview/1.0 * update api-version in examples * add v2 files to readme * fix avacado errors * Adding string length limit to the descriptions for feature state. Adding string length limit to the descriptions for feature state. * Adding ontology element to the WFS resopnse examples. Adding ontology element to the WFS resopnse examples. * Updating length to 1000 from 1024. Updating length to 1000 from 1024. * Update dataset v2 descriptions and examples. * Update the examples to have the right details. * reran linter; added spellcheck words * more linting: 202 description alignment * fixed example linting for alias, data, dataset * example linting changes for conv, fs, tileset * change featurestateset patch to put * autorest linting fixes * Reverting FeatureState body to include array to match V1 body and response. * adding missing operationIds * added examples; more linting * remove x-ms-long-running * Update alias documentation for resourceId -> creatorDataItemId change Co-authored-by: Robert Johnson Co-authored-by: Subbarayudu Kamma * Update attribute name for message metadata (#14206) * Update attribute name for message metadata * Apply Prettier * Prettier fix Co-authored-by: Po Tsang * Re-add a previously erroneously removed PUT API for /networkConfig/VirtualNetwork (#14018) * Add CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck, and site-level virtualNetworkSubnetId field * Add site-level virtualNetworkSubnetId field * Tabs vs spaces * Removing the new property since it's technically a 'breaking change' * Add changes needed for correct .NET SDK generation issues. Reference PR: https://github.com/Azure/azure-sdk-for-net/pu… * Add xms-ids for Logic (#17663) * add xms-ids for Logic * fix format * [Hub Generated] Review request for Microsoft.ManagedServices to add version preview/2022-01-01-preview (#17089) * Adds base for updating Microsoft.ManagedServices from version preview/2020-02-01-preview to version 2022-01-01-preview * Updates readme * Updates API version in new specs and examples * Add 2022 API swagger details * Prettier fix changes * Fix for operations API * Fix example ref * Further swagger fixes * Further swagger fixes * Changed system data definition ref to v3 * add x-ms-enum for management groups (#17231) * Adding InformationProtectionAws offering (#16990) * Adding InformationProtectionAws offering * Rename * Semantic validation fix Co-authored-by: Sapir Elmakayes * [Hub Generated] Public private branch 'yuwzho/deprecate-appplatform-api-version' (#17506) * Deprecate AppPlatform 2019-05-01-preview API version * remove related SDK code Co-authored-by: Yuchao Yan * Adding xms-ids to AzureStack (#17610) * Adding xms-ids to AzureStack * correct tag version * Update pull_request_assignment.yml (#17445) * Update pull_request_assignment.yml * Update pull_request_assignment.yml * AKS: update description for security profile (#17700) * Update managedClusters.json * Update managedClusters.json * Update managedClusters.json * Update managedClusters.json * Updated AfdEndpoint and CheckNameAvailability API with additional pro… (#17518) * Updated AfdEndpoint and CheckNameAvailability API with additional property AutoGeneratedDomainNameLabelScope Update afdx.json * Added AutoGeneratedDomainNameLabelScope property into CheckNameAvailabilityInput instead of checkHostNameAvailabilityInput * Update cdn.json Updated the property name and its description. * Update d property name in examples. * Fix the reference error and a typo * Fix the reference error in CDN API * test * Updated property name to camelCase style * Updated the property name to camel case style. * Added new checkNameAvailability API for afdx * Updated the parameter references in new API * Added input and output type separate from CDN one for new checkNameAvailability API * Updated the input and out reference path for new API * Added AfdResourceType for new API * Updated the definition name of input and output for new API * Updated input name in example. * Include the required property type in the example. * Rename the new API to CheckEndpointNameAvailability * Microsoft.OperationalInsights: Adding table migrate. (#17654) * Microsoft.OperationalInsights: Adding table migrate. * Better description for migrate. * Adding xms ids to DataboxEdge (#17646) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2021-10-01 (#17560) * Adding RI Async API swagger from 2019-11-01 version * add example files * add definitions * fix lint errors * add missing definition * add missing type * resolve error * removing uber definition * prettier fix * rename operation status type to avoid conflict with RI Async API operation status * Adding xms-ids for ChangeAnalysis (#17626) * Adding xms-ids for ChangeAnalysis * Adding xms-ids for ChangeAnalysis * add @Azure/api-stewardship-board as reviewer for data-plane (#17722) * Fix the missing parameter error in kusto spec (#17721) * Adding xms-ids for Commerce (#17628) * Adding xms ids for Consumption (#17637) * Adding xms ids to Azure Arc Data (#17648) * Adding xms-ids for Botservice (#17617) * Adding xms-ids for Botservice * corrections after rebase * Adding xms-ids for ContainerInstance (#17638) * Feature/cplat 2021 10 01 (#17548) * Feature/cplat 2021 10 03 (#16512) * update new api version branch with base * change 2021-10-03 to 2021-10-01 * Update readme.md * fix folder structure * add community gallery * Feature/cplat 2021 10 03 (#16512) * update new api version branch with base * change 2021-10-03 to 2021-10-01 * Update readme.md * fix folder structure * add community gallery * remove sharedGallery and communityGallery * Gallery 10-01 change (community gallery, CVM) (#16824) * add new api version 2020-09-30 for gallery.json * add support for api change, sharing profile related * update, change post to patch * fix model validation error * fix typo * add shared gallery api * update * fix typo * update * update * update * chagne new api version to preview * update readme.md and nit * remove some required field and make groups readonly * add swagger support for Grace's and Tim's work * error fix * error fix * change api version name to 2020-09-30 withour 'preview' * update * fix typo * address pr comment * set modelAsString to true for gallery sharing-related enum * update, fix merge * remove duplicate entry * shared gallery, change id to identifier.uniqueId * fix typo * update, remove x-ms-azure-resource for shared gallery * change name of Permissions to avoid SDK code build error * update * add new line * correct reset * update * save * update * fix * update * update * update * resolve CI error * update * Edge zone (#17097) * added target extended locations to the caps gallery schema and added an example file * fixed a comma * Update readme.md * Rename specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/gallery/CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocations.json to specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocations.json * Update readme.md * update * address comment * resolve CI Co-authored-by: Andrew Sager Co-authored-by: Theodore Chang * save (#17600) Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Co-authored-by: Andrew Sager * Adding xms-ids for Communication (#17662) * Adding xms-ids for Communication * adding note in readme * Adding xms-ids for AppConfiguration (#17587) * Adding xms-ids for AppConfiguration * corrections after rebasing * prettier fix * Adding xms ids for Chaos (#17661) * Adding x-ms identifiers for adp (#17572) * adding x-ms identifiers for adp * corrections from rebasing * [Data Factory] Add swagger for script activity (#17686) * Add swagger for script activity * Resolve issues * remove x-ms-identifier * [NetAppFiles] Anf 17315 net app files 2021 10 01 (#17296) * Add folder for api-version 2021-10-01 * Apply 2021-10-01 Changes * Remove snapshotSingleFile restore example * Revert vs code change to settings * Add unixPermissions to volumePatchProperties * Remove volume Relocation from 2021-10-01 * Remove zones from this api-version * Add Snapshot restoreFiles * Fix newly added validation issue MISSING_PATH_PARAMETER_DEFINITION * Remodel list Replications * Remove listReplication for api-version 2021-10-01 * Fix quotaLimits in examples * Add subvolumes api * Add subvolumes to custom words * Add parentpath custom word * Revert operationId to Volumes_ReplicationStatus * subvolumeProperties size write-only * Revert "subvolumeProperties size write-only" This reverts commit 243bb48ba6e5bea1f742492cfc6496d572103613. * subvolumeProperties size write-only take2 * prettier * update (#17481) * Adding xms ids for Blockchain (#17714) * Adding xms-ids for Blockchain * Update readme.md * Update readme.python.md Co-authored-by: Yuchao Yan * Adding xms-ids to ContainerService (#17640) * Adding xms-ids to ContainerService * prettier fix * Adding xms-ids to ContainerRegistry (#17639) * Add x-ms-identifiers for datacatalog (#17739) * Adding xms-ids for CommonTypes (#17629) * Adding xms-ids for CommonTypes * corrections after rebase * Review request for Microsoft.ContainerService to add version 2022-01-02-preview (#17579) * Adds base for updating Microsoft.ContainerService from version preview/2021-11-01-preview to version 2022-01-02-preview * Updates readme * Updates API version in new specs and examples * Add NetworkPlugin none option (#17393) * Update readme to help generate SDK (#17372) * update readme to help generate SDK * update readme * fix golang readme * fix tag * Add adminUsers in aadprofile (#17367) * Add adminUsers in aadprofile * Update description * Support query parameter 'format' in listClusterUserCredential handler (#17211) * Support query parameter 'format' in listClusterUserCredential handler * Fix lint * Fix typo * Add property HostGroupID and its examples (#17459) * Add property HostGroupID and its examples * fix format issue * add more details for Dedicated host group Co-authored-by: Jianping Zeng * Revert "Add adminUsers in aadprofile (#17367)" (#17522) This reverts commit ba6e6563690b800d7bda463baecde152fe088884. * fix conflict (#17624) Co-authored-by: Matt Stam Co-authored-by: Tongyao Si Co-authored-by: Jianping Zeng Co-authored-by: Jianping Zeng * Adding xms ids to Advisor (#17713) * Adding x-ms-identifiers for Advisor * adding the preview xms ids * reverting preview file changes * fix model validation errors * prettier fix * revert additional fixes * Adding xms ids for Authorization (#17735) * Adding x-ms-ids for Authorization * corrections after rebase * Adding xms-ids for BareMetalInfrastructure (#17612) * Adding xms-ids for BareMetalInfrastructure * adding xms for newer stable version * Adding xms-ids for Batch (#17613) * Adding xms-ids for Attestation (#17591) * Adding xms-ids for Attestation * revert common types file * Adding xms-ids for CDN (#17625) * Adding xms-ids for CDN * corrections after rebase * checkout readme * Adding xms ids to azsadmin (#17724) * Adding xms-ids for AzsAdmin - rebased * reverting stale changes * Adding additional xms * prettier fix * Added listServicePrincipalId (#17068) * Added listServicePrincipalId * Fixed few errors * Fixed spelling * Fixed few errors * Fixed few errors * Added listServicePrincipalId * Fixed one error * Fixed few errors * Fixed error * Fixed error * Updated tag to trigger a build * Fixed spelling * Fixed comment * Changed from Post to get to work in ARM template * fixed failure * fixed failure * fixed warning * Refferred ProxyResource * Fixed ProxyResource and another comment * Added systemData for ServicePrincipal * Added Collection GET for Singleton * Fixed error and warnings * Fixed PrettierCheck error * adding xms-ids for AzureData (#17607) * Adds base for updating Microsoft.CostManagement from version preview/2020-12-01-preview to version 2022-02-01-preview * Updates readme * Updates API version in new specs and examples * Base check-in * Adding Scheduled Actions API * Fixing typos * Fixing models * prettify * updating models * trying to get daysOfWeek enum to work * u * Fixing examples * Fixing FileDestination * Minor change to trigger doc generation * Fixing errors * Prettifying remaining examples * Adding version 2022-04-01-preview * updating version in readme * u * Updating readme * updating package-lock.json * Updating response in checkNameAvailability response * Revert "updating package-lock.json" This reverts commit 2c7814ae1f3c46aecde3c6d7b421e84b17de640c. * Revert "Prettifying remaining examples" This reverts commit d9650f3ad1fde00e8b895e4c0b4f9c0398f5bab9. * Reverting change to package-lock.json * Fixing examples * Adding more api-versions in readme * Updating readme * Marking SystemData readonly and updating readme * Fixing readme * Removing other versions from readme * Adding common types * Updating references * Updating examples * Removing reference to types.json to work around composition errors * Removing conflicting Resource definition from exports.json * Removing Reason definition * Resolving merge conflicts * Adding common-types * Fixing common-types ref in exports.json * Fixing references and removing Resource definition * Reverting changes to pricesheets * Adding Operations_List example * Adding example * Reverting breaking change * Reverting a breaking change and using ApiVersionParameter from types.json * Reverting api-version parameter change since that flagged as a breaking change Co-authored-by: Christine Fu <45861452+christinemfu@users.noreply.github.com> Co-authored-by: Liran-E Co-authored-by: Liran Englender Co-authored-by: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Co-authored-by: srrudray <53835817+srrudray@users.noreply.github.com> Co-authored-by: Matt <57731498+mattmsft@users.noreply.github.com> Co-authored-by: gaoyp830 <51546332+gaoyp830@users.noreply.github.com> Co-authored-by: xerxestph <78384060+xerxestph@users.noreply.github.com> Co-authored-by: Po Tsang Co-authored-by: Jingshu923 <52914166+Jingshu923@users.noreply.github.com> Co-authored-by: David Pokluda <46501915+dpokluda@users.noreply.github.com> Co-authored-by: Laurent Mazuel Co-authored-by: Nikhil Co-authored-by: Nikhil Kumar Co-authored-by: Yuchao Yan Co-authored-by: Auðunn Co-authored-by: Dudi Likvornik Co-authored-by: Dudi Likvornik Co-authored-by: eswatad <51605025+eswatad@users.noreply.github.com> Co-authored-by: Mike Pateras <35780775+paterasMSFT@users.noreply.github.com> Co-authored-by: Abigail Hartman Co-authored-by: Abigail Hartman Co-authored-by: Kareem Yousef Co-authored-by: Abby Hartman Co-authored-by: msyache <70287970+msyache@users.noreply.github.com> Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Co-authored-by: dabenhamMic <74346518+dabenhamMic@users.noreply.github.com> Co-authored-by: Mel M <50640763+melmullen@users.noreply.github.com> Co-authored-by: Muaz Mian Co-authored-by: varun kumar kunchakuri <66476965+vakuncha@users.noreply.github.com> Co-authored-by: Ace Eldeib Co-authored-by: tengpanpt <68668066+tengpanpt@users.noreply.github.com> Co-authored-by: Teng Pan Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com> Co-authored-by: kuchatur-ms <69152307+kuchatur-ms@users.noreply.github.com> Co-authored-by: jsedlak-microsoft <65620804+jsedlak-microsoft@users.noreply.github.com> Co-authored-by: jastenze <71854693+jastenze@users.noreply.github.com> Co-authored-by: Larry Osterman Co-authored-by: Omar Rodriguez <73562205+omrodrig@users.noreply.github.com> Co-authored-by: Jimmy Campbell Co-authored-by: Suna Liu Co-authored-by: sagamzu <52034287+sagamzu@users.noreply.github.com> Co-authored-by: Yihang Co-authored-by: sonalverm <73529783+sonalverm@users.noreply.github.com> Co-authored-by: Weidong Xu Co-authored-by: Ritesh chitlangia <60164879+riteshchitlangia1@users.noreply.github.com> Co-authored-by: jiacheng-L <71623842+jiacheng-L@users.noreply.github.com> Co-authored-by: kim-soohwan <40476315+kim-soohwan@users.noreply.github.com> Co-authored-by: Soohwan Kim Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> Co-authored-by: zhangyan133 <77086185+zhangyan133@users.noreply.github.com> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) Co-authored-by: 陈箭飞 <32889038+chenjianfei2017@users.noreply.github.com> Co-authored-by: Your Name Co-authored-by: Cameron Taggart Co-authored-by: jdhms <77470403+jdhms@users.noreply.github.com> Co-authored-by: Alexander Batishchev Co-authored-by: dosegal <51155368+dosegal@users.noreply.github.com> Co-authored-by: Bruce Johnston Co-authored-by: Abdullah Syed <50675866+absyed@users.noreply.github.com> Co-authored-by: stuartko <47676853+stuartko@users.noreply.github.com> Co-authored-by: pvsraviteja <67624658+pvsraviteja@users.noreply.github.com> Co-authored-by: Lei Ni <7233663+leni-msft@users.noreply.github.com> Co-authored-by: Nick Schonning Co-authored-by: Guosen Wang Co-authored-by: Suba Co-authored-by: zhaomuzhi Co-authored-by: Vinay Rajmal Soni Co-authored-by: jopet@microsoft.com Co-authored-by: Josh Peterson <15050193+joshanator@users.noreply.github.com> Co-authored-by: chandrikagonuguntla Co-authored-by: Chandrika Gonuguntla Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> Co-authored-by: aarongas Co-authored-by: Saar Shen Co-authored-by: Dongwei Wang Co-authored-by: Dongwei Wang Co-authored-by: Junbo Wang Co-authored-by: Hervey Wilson Co-authored-by: Janusz Lembicz Co-authored-by: Arcturus Co-authored-by: Alexander Schmidt Co-authored-by: ThomasDai <73230321+ThomasDai@users.noreply.github.com> Co-authored-by: Trask Stalnaker Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: alexsavo-ms <78455310+alexsavo-ms@users.noreply.github.com> Co-authored-by: Joshua McCarthy Co-authored-by: jmccarthy Co-authored-by: TJ Egbejimba Co-authored-by: averyrob <78236769+averyrob@users.noreply.github.com> Co-authored-by: Aman Swaika Co-authored-by: Aman Swaika Co-authored-by: Gaurav Mishra (IDENTITY) Co-authored-by: Alfredo Santamaria Co-authored-by: Alfredo Santamaria Gomez Co-authored-by: us6193 Co-authored-by: Umang Shah Co-authored-by: Krishna Sri Somepalli Co-authored-by: Srinivas Co-authored-by: Xiang Yan Co-authored-by: Krista Pratico Co-authored-by: Srikanta <51379715+srnagar@users.noreply.github.com> Co-authored-by: Jose Manuel Heredia Hidalgo Co-authored-by: rkapso Co-authored-by: Rishi Kapoor Co-authored-by: Subrahmanyam Mandavilli Co-authored-by: Xing Zhou Co-authored-by: mkarmark Co-authored-by: Heath Stewart Co-authored-by: Ji Wang Co-authored-by: docohe <54349195+docohe@users.noreply.github.com> Co-authored-by: taogems <55105930+taogems@users.noreply.github.com> Co-authored-by: Amit Elran Co-authored-by: Amit Elran Co-authored-by: Mayank Aggarwal Co-authored-by: Mayank Aggarwal Co-authored-by: FAREAST\zakinkh Co-authored-by: Congrui <43364740+conhua@users.noreply.github.com> Co-authored-by: jadrefke Co-authored-by: Austin Drefke Co-authored-by: Amr Elroumy (Work) <77645021+amrelroumy-msft@users.noreply.github.com> Co-authored-by: akashkeshari Co-authored-by: Akash Keshari Co-authored-by: simanor <49607823+simanor@users.noreply.github.com> Co-authored-by: Tom FitzMacken Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> Co-authored-by: bowgong <56386108+bowgong@users.noreply.github.com> Co-authored-by: Jack Lichwa <52512203+jlichwa@users.noreply.github.com> Co-authored-by: Samir Solanki Co-authored-by: jainharsh98 Co-authored-by: Shubham Gupta Co-authored-by: ssss141414 Co-authored-by: JianyeXi <59603451+jianyexi@users.noreply.github.com> Co-authored-by: jianyexi Co-authored-by: Mike Budzynski <40186513+mikebudzynski@users.noreply.github.com> Co-authored-by: litchiyangMSFT <64560090+litchiyangMSFT@users.noreply.github.com> Co-authored-by: Liangying.Wei Co-authored-by: mayank88mahajan Co-authored-by: Ritwik Rajendra <21337621+ritwik8119@users.noreply.github.com> Co-authored-by: Ritwik Rajendra Co-authored-by: Weiguo Zhang Co-authored-by: maddieminn <79888413+maddieminn@users.noreply.github.com> Co-authored-by: nilgupta6 <78136736+nilgupta6@users.noreply.github.com> Co-authored-by: Yuan Xi Co-authored-by: Kai-Wen Feng <82062838+kaiwenfeng4086@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yuping Wei <56525716+yupwei68@users.noreply.github.com> Co-authored-by: Dania Etienne Co-authored-by: Dania Etienne Co-authored-by: Yang Chen Co-authored-by: yl-ms <79939366+yl-ms@users.noreply.github.com> Co-authored-by: Aditi <12823918+aditimalladi@users.noreply.github.com> Co-authored-by: Aditi Co-authored-by: Amit Singh <31076927+amisi01@users.noreply.github.com> Co-authored-by: Meha Kaushik Co-authored-by: Meha Kaushik Co-authored-by: Daniel Stack Co-authored-by: giakas Co-authored-by: Christopher Bennage Co-authored-by: Ramu Co-authored-by: vipinhas <82088177+vipinhas@users.noreply.github.com> Co-authored-by: Jorge Cotillo Co-authored-by: yuzhangyi <44692931+yuzhangyi@users.noreply.github.com> Co-authored-by: zhanyu2014 Co-authored-by: ityankel <47292630+ityankel@users.noreply.github.com> Co-authored-by: hongxian <48581117+hongxian@users.noreply.github.com> Co-authored-by: Hongxian Yao Co-authored-by: nichatur <69816349+nichatur@users.noreply.github.com> Co-authored-by: Ajit Navasare Co-authored-by: Himanshu Chandel Co-authored-by: Himanshu Chandel Co-authored-by: Kalpesh Chavan <18593210+KalpeshChavan12@users.noreply.github.com> Co-authored-by: Kalpesh Chavan Co-authored-by: Bin Yu <56588422+BinYuMSFT@users.noreply.github.com> Co-authored-by: Bin Yu Co-authored-by: bar810 Co-authored-by: harini-ms <34797776+harini-ms@users.noreply.github.com> Co-authored-by: Harini Co-authored-by: alexandra142 Co-authored-by: Alexandra Lamiova Pistrakova Co-authored-by: Ray Chen Co-authored-by: Parv Saxena Co-authored-by: Parv Saxena Co-authored-by: iscai-msft Co-authored-by: stivanov-git <61129265+stivanov-git@users.noreply.github.com> Co-authored-by: neku <82562198+Neku-microsoft@users.noreply.github.com> Co-authored-by: jeffj6123 Co-authored-by: ItaySofer Co-authored-by: Itay Sofer Co-authored-by: Luke Slevinsky Co-authored-by: yanfa317 <53584318+yanfa317@users.noreply.github.com> Co-authored-by: Noam Dishon <30979046+dishonono@users.noreply.github.com> Co-authored-by: sandeepparab Co-authored-by: Sandeep Parab Co-authored-by: kryalama <66494519+kryalama@users.noreply.github.com> Co-authored-by: David Watrous Co-authored-by: Johnson Yang Co-authored-by: wwendyc Co-authored-by: Wendy Chang Co-authored-by: Pradeep Kintali <50682039+pradeepkintali@users.noreply.github.com> Co-authored-by: Jeff Couckuyt Co-authored-by: Robert Johnson Co-authored-by: Subbarayudu Kamma Co-authored-by: aleksbol Co-authored-by: Naveed Aziz Co-authored-by: Thomas Reis Co-authored-by: Karthik Kunjithapatham <77180268+karthikku-2020@users.noreply.github.com> Co-authored-by: Ben Viglietta Co-authored-by: Ben Viglietta Co-authored-by: v-ajnava Co-authored-by: Shuai Wang Co-authored-by: colawwj <70128817+colawwj@users.noreply.github.com> Co-authored-by: angouloure <79340104+angouloure@users.noreply.github.com> Co-authored-by: SatishRanjan Co-authored-by: Calvin Chan Co-authored-by: Connor McMahon Co-authored-by: JennyLawrance Co-authored-by: Sanchit Mehta Co-authored-by: mitagarg Co-authored-by: Mita Garg Co-authored-by: HugoLabraMSFT <96317755+HugoLabraMSFT@users.noreply.github.com> Co-authored-by: cfurmanczyk <89105175+cfurmanczyk@users.noreply.github.com> Co-authored-by: XI JIN Co-authored-by: Xi Jin Co-authored-by: Ochirkhuyag Co-authored-by: Ochi Co-authored-by: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Co-authored-by: amirdach Co-authored-by: Amir Dachabash Co-authored-by: Zhenfeng Co-authored-by: christianvalencia7 <35338973+christianvalencia7@users.noreply.github.com> Co-authored-by: Christian Valencia Co-authored-by: Alan Po-Ching Yang Co-authored-by: NickKouds Co-authored-by: Ayush Dalmia <31706656+adalmia96@users.noreply.github.com> Co-authored-by: Ayush Co-authored-by: osmuller <61298360+osmuller@users.noreply.github.com> Co-authored-by: PingZhu2232 <36140352+PingZhu2232@users.noreply.github.com> Co-authored-by: Ping Zhu Co-authored-by: Alan Feng <15934598+yingru97@users.noreply.github.com> Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Ruoxuan Wang <52271048+ruowan@users.noreply.github.com> Co-authored-by: sunil-archt <77359197+sunil-archt@users.noreply.github.com> Co-authored-by: Ravi Co-authored-by: Ravi Yadav Co-authored-by: Lucas Santos Co-authored-by: Lucas Santos Co-authored-by: FadyEssam2 <57910919+FadyEssam2@users.noreply.github.com> Co-authored-by: Fady Essam Co-authored-by: Vishnu Priya Ananthu Sundaram Co-authored-by: Anant <39825466+anantshankar17@users.noreply.github.com> Co-authored-by: Andreas Lachenmann <53483608+andreasjl@users.noreply.github.com> Co-authored-by: Tianen <347142915@qq.com> Co-authored-by: Hongyang Du (hond) Co-authored-by: Zhixiang Zhan Co-authored-by: Yuwei Zhou Co-authored-by: tianxchen-ms <403562789@qq.com> Co-authored-by: Tianxiang Chen Co-authored-by: bpramod Co-authored-by: subbartt <54743354+subbartt@users.noreply.github.com> Co-authored-by: Anat Gilenson <53407600+anat-gilenson@users.noreply.github.com> Co-authored-by: Anat Gilenson Co-authored-by: Sean McCullough <44180881+seanmcc-msft@users.noreply.github.com> Co-authored-by: vasundhraManhas <42461257+vasundhraManhas@users.noreply.github.com> Co-authored-by: Vasundhra Manhas Co-authored-by: Thakur Ashutosh Suman Co-authored-by: Theertharaj <40805847+thramu@users.noreply.github.com> Co-authored-by: Frey-Wang Co-authored-by: Jorin Mejia Co-authored-by: Jorin Mejia Co-authored-by: yunheMsft <69871746+yunheMsft@users.noreply.github.com> Co-authored-by: SINADELL Co-authored-by: Sindhuri Co-authored-by: Jessica Li Co-authored-by: Chenglong Liu <48578056+ChenglongLiu@users.noreply.github.com> Co-authored-by: Chenglong Liu Co-authored-by: t-bzhan <61817681+t-bzhan@users.noreply.github.com> Co-authored-by: Bo Zhang Co-authored-by: rrahulms <42217269+rrahulms@users.noreply.github.com> Co-authored-by: laurent-mic <41535579+laurent-mic@users.noreply.github.com> Co-authored-by: sameerpatro <88674399+sameerpatro@users.noreply.github.com> Co-authored-by: George Moussa Co-authored-by: Vaishnavi Janardhan Co-authored-by: sashanm <54701252+sashanm@users.noreply.github.com> Co-authored-by: t-vjanardhan <77781522+t-vjanardhan@users.noreply.github.com> Co-authored-by: Nidhi Jain Co-authored-by: nija-dev <67132984+nija-dev@users.noreply.github.com> Co-authored-by: Vaishnavi Janardhan Co-authored-by: Paul Hsu Co-authored-by: Youssef Shahin Co-authored-by: Nikki Zuko <38327895+nizuko@users.noreply.github.com> Co-authored-by: joseph-porter <69636506+joseph-porter@users.noreply.github.com> Co-authored-by: SanjaMalesevic <53555921+SanjaMalesevic@users.noreply.github.com> Co-authored-by: Jonathan Innis Co-authored-by: savaradh <60020169+savaradh@users.noreply.github.com> Co-authored-by: esdhrgl1984 <44240496+esdhrgl1984@users.noreply.github.com> Co-authored-by: vasanthrajams <60414148+vasanthrajams@users.noreply.github.com> Co-authored-by: larisaborodina <58491292+larisaborodina@users.noreply.github.com> Co-authored-by: Young Bu Park Co-authored-by: JiahuiPeng <46921893+804873052@users.noreply.github.com> Co-authored-by: Alex Tsao Co-authored-by: Alex Tsao Co-authored-by: AriZavala2 <77034370+AriZavala2@users.noreply.github.com> Co-authored-by: Chou Hu Co-authored-by: Charlie Li <39974812+chengliangli0918@users.noreply.github.com> Co-authored-by: Charlie Li Co-authored-by: rsamigullin <89222124+rsamigullin@users.noreply.github.com> Co-authored-by: Matthew Christopher Co-authored-by: rohkuma-microsoft <90003118+rohkuma-microsoft@users.noreply.github.com> Co-authored-by: Damodar Avadhani Co-authored-by: Tom Harvey Co-authored-by: Samuel Kuang Co-authored-by: Thomas Pham Co-authored-by: hivyas <61890270+hivyas@users.noreply.github.com> Co-authored-by: Anne Thompson Co-authored-by: LarryZhang19 <35974877+LarryZhang19@users.noreply.github.com> Co-authored-by: Daniel Rocha Co-authored-by: Ishay Dahan Co-authored-by: prince3332 Co-authored-by: Prince Gupta Co-authored-by: Rohan Kulkarni <36928710+rokulka@users.noreply.github.com> Co-authored-by: najian Co-authored-by: Nan Jiang Co-authored-by: swvenkats <87731907+swvenkats@users.noreply.github.com> Co-authored-by: Jie Shen Co-authored-by: Wenhao Zhang Co-authored-by: Xuyang Cao Co-authored-by: tabenari <73182585+tabenari@users.noreply.github.com> Co-authored-by: Kyle Rush Co-authored-by: 00Kai0 Co-authored-by: Jenny Winkler <52216782+jewinkle@users.noreply.github.com> Co-authored-by: Mario Hernandez Co-authored-by: kerend Co-authored-by: korosensei Co-authored-by: Omar Elhariry Co-authored-by: Maddie Lucas <85301813+maddiemlucas@users.noreply.github.com> Co-authored-by: Joel Hendrix Co-authored-by: Taras Vozniuk Co-authored-by: Taras Vozniuk Co-authored-by: darkoa-msft <61987922+darkoa-msft@users.noreply.github.com> Co-authored-by: Wan Yang Co-authored-by: Zhenglai Zhang Co-authored-by: Mikhail Co-authored-by: Ritvika Reddy Nagula Co-authored-by: tejasshah7 <49326906+tejasshah7@users.noreply.github.com> Co-authored-by: Ishani Gupta Co-authored-by: Ishani Gupta Co-authored-by: dtuCloud Co-authored-by: Weiheng Li Co-authored-by: Weiheng Li Co-authored-by: Henry Chen Co-authored-by: irrogozh Co-authored-by: amosarbiv-work <76393841+amosarbiv-work@users.noreply.github.com> Co-authored-by: alexgoldschmidt <33302838+alexgoldschmidt@users.noreply.github.com> Co-authored-by: Alex Goldschmidt Co-authored-by: anirbanthakur <89666721+anirbanthakur@users.noreply.github.com> Co-authored-by: Anirban Thakur Co-authored-by: Josephine Qiu Co-authored-by: Erel Hansav Co-authored-by: Erel Hansav Co-authored-by: Alexander Kaplan Co-authored-by: jimmyshie123 Co-authored-by: Jimmy Xie Co-authored-by: Aishwarya C S <24403906+Aishwarya-C-S@users.noreply.github.com> Co-authored-by: misbamomin <79725363+misbamomin@users.noreply.github.com> Co-authored-by: Sandy Cai Co-authored-by: Yinglue Zhang Co-authored-by: caiqing Co-authored-by: YinglueZhang-MS <78456380+YinglueZhang-MS@users.noreply.github.com> Co-authored-by: surashed <55134940+surashed@users.noreply.github.com> Co-authored-by: TomerHmsft <92307325+TomerHmsft@users.noreply.github.com> Co-authored-by: Sapir Elmakayes <32778998+SapirElmakayes@users.noreply.github.com> Co-authored-by: Sapir Elmakayes Co-authored-by: Daniel Rocha Co-authored-by: rperezzamora <80124228+rperezzamora@users.noreply.github.com> Co-authored-by: kavskalyan Co-authored-by: REDMOND\amisi Co-authored-by: Anuj Toshniwal Co-authored-by: Abhijit Karanjkar Co-authored-by: Praful Johari Co-authored-by: visunda Co-authored-by: Vivek Sundararajan Co-authored-by: vivek-microsoft <32766101+vivek-microsoft@users.noreply.github.com> Co-authored-by: Chenyang Liu Co-authored-by: PatrickTseng Co-authored-by: sbudhi-msft <81762203+sbudhi-msft@users.noreply.github.com> Co-authored-by: Rahul Singh <53578268+rahuls-microsoft@users.noreply.github.com> Co-authored-by: Gaurav Co-authored-by: Gaurav Bang Co-authored-by: Xuyang Cao Co-authored-by: sanil7777777 <90470998+sanil7777777@users.noreply.github.com> Co-authored-by: MaxWrightMicrosoft <89222647+MaxWrightMicrosoft@users.noreply.github.com> Co-authored-by: shaileshsk94 <52837212+shaileshsk94@users.noreply.github.com> Co-authored-by: Shailesh Kelkar Co-authored-by: Mark Cowlishaw Co-authored-by: Taras Vozniuk Co-authored-by: sashahdo <64434373+sashahdo@users.noreply.github.com> Co-authored-by: Caihua Rui <71814127+CaihuaRui@users.noreply.github.com> Co-authored-by: sukodava <78733210+sukodava@users.noreply.github.com> Co-authored-by: Robert Gao Co-authored-by: uratzmon <81904834+uratzmon@users.noreply.github.com> Co-authored-by: kesharma <74746991+kesharma@users.noreply.github.com> Co-authored-by: rickysun93 Co-authored-by: Haoran Sun Co-authored-by: Audunn Baldvinsson Co-authored-by: Elad Perets <7473455+eladperets@users.noreply.github.com> Co-authored-by: Dapeng Zhang Co-authored-by: Avi Paz Co-authored-by: vikramadityab72 Co-authored-by: Yanqiong Chen <86596306+yanqiongchen@users.noreply.github.com> Co-authored-by: xunsun-commits <84804232+xunsun-commits@users.noreply.github.com> Co-authored-by: Shuo LI Co-authored-by: Tianyun Gao (MSFT) <65581162+Tianyun-G@users.noreply.github.com> Co-authored-by: Avinash Co-authored-by: bannama Co-authored-by: Bhaskar Annamalai Co-authored-by: leigharubin <78169930+leigharubin@users.noreply.github.com> Co-authored-by: Zhenglai Zhang Co-authored-by: Yang Yuan Co-authored-by: zesluo Co-authored-by: Saif Kayani Co-authored-by: Robert Lyon <35980532+rolyon@users.noreply.github.com> Co-authored-by: avjerafi <64891828+avjerafi@users.noreply.github.com> Co-authored-by: Avi Jerafi Co-authored-by: Jack Ma Co-authored-by: Nick Hardwick <31860550+nickghardwick@users.noreply.github.com> Co-authored-by: xolve Co-authored-by: Ravi Arora Co-authored-by: Maor Leger Co-authored-by: Xingdong Li Co-authored-by: Xingdong Li Co-authored-by: Adriano Arce Co-authored-by: ILAVELAN KANNIAPPAN Co-authored-by: Roslyn Lu Co-authored-by: Roslyn Lu Co-authored-by: yoram-cohen-microsoft <92515642+yoram-cohen-microsoft@users.noreply.github.com> Co-authored-by: Braden Watkins Co-authored-by: Braden Watkins Co-authored-by: orkayam <68549999+orkayam@users.noreply.github.com> Co-authored-by: Orel Kayam Co-authored-by: vayada Co-authored-by: Andrew Peacock Co-authored-by: Hande Adiguzel <89477033+handeeeadiguzel@users.noreply.github.com> Co-authored-by: Christian Eduardo Palomares Peralta Co-authored-by: Alexander Zaslonov Co-authored-by: DreamlessA Co-authored-by: Alan Feng Co-authored-by: Jatin Sanghvi <20547963+JatinSanghvi@users.noreply.github.com> Co-authored-by: Nicolás Barrera Co-authored-by: Nicolás Barrera Co-authored-by: VitaliyKurokhtin Co-authored-by: Christian Palomares Co-authored-by: RupengLiu Co-authored-by: rezmicrosoft <70175798+rezmicrosoft@users.noreply.github.com> Co-authored-by: rez1 Co-authored-by: GovardhanaDK <36787828+GovardhanaDK@users.noreply.github.com> Co-authored-by: Govardhana D K Co-authored-by: Jane Lijuan Zhang Co-authored-by: inballeibovitch <74146365+inballeibovitch@users.noreply.github.com> Co-authored-by: Nick Depinet Co-authored-by: Nick Depinet Co-authored-by: Deyaaeldeen Almahallawi Co-authored-by: Nitesh Vijay Co-authored-by: anujtoshniwal <62551957+anujtoshniwal@users.noreply.github.com> Co-authored-by: Ajay Parulekar <79739098+ajparule@users.noreply.github.com> Co-authored-by: pjohari-ms <84465928+pjohari-ms@users.noreply.github.com> Co-authored-by: KeYu(AnkhSpirit) <33389195+KeYu-AnkhSpirit@users.noreply.github.com> Co-authored-by: Travis Prescott Co-authored-by: Mohamed Abbas Co-authored-by: Tal Shoham <87926500+tshoham@users.noreply.github.com> Co-authored-by: Tamir Ben-Arie Co-authored-by: Mohit Chakraborty <8271806+Mohit-Chakraborty@users.noreply.github.com> Co-authored-by: Vu Tran <36055117+vutran01@users.noreply.github.com> Co-authored-by: bganapa Co-authored-by: Devanshu Singh <8132290+thisisdevanshu@users.noreply.github.com> Co-authored-by: Sunny Patel Co-authored-by: Sunny Patel Co-authored-by: Devanshu Singh Co-authored-by: Jim Harris <72156062+MicrosoftJim@users.noreply.github.com> Co-authored-by: Akanksha Bhattacharyya Co-authored-by: Akanksha Bhattacharyya Co-authored-by: Tony Vargas Co-authored-by: Kamil Sobol <61715331+kasobol-msft@users.noreply.github.com> Co-authored-by: giladsu <43436811+giladsu@users.noreply.github.com> Co-authored-by: Milan Brkic Co-authored-by: Tyler Lloyd Co-authored-by: Li Ma Co-authored-by: hbc Co-authored-by: Bradley Bridges Co-authored-by: damodaravadhani <91929893+damodaravadhani@users.noreply.github.com> Co-authored-by: pednekarpraj <72415888+pednekarpraj@users.noreply.github.com> Co-authored-by: Lior Abadi Co-authored-by: Lior Abadi Co-authored-by: Eli Arbel Co-authored-by: jbuls <48029054+jbuls@users.noreply.github.com> Co-authored-by: ajbrown821 <96266510+ajbrown821@users.noreply.github.com> Co-authored-by: Wenhao Zhang Co-authored-by: Qingyi Liu <34502364+smile37773@users.noreply.github.com> Co-authored-by: Xiaoyun Ding Co-authored-by: Xiaoyun Ding Co-authored-by: ninpan-ms <71061174+ninpan-ms@users.noreply.github.com> Co-authored-by: zhoufenqin Co-authored-by: komakkar <71260242+komakkar@users.noreply.github.com> Co-authored-by: AJ Brown Co-authored-by: Heath Stewart Co-authored-by: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Co-authored-by: Bogdan Ostojic <49651629+ostojicb@users.noreply.github.com> Co-authored-by: Bogdan Ostojic Co-authored-by: swagger-automation Co-authored-by: garubin <74899419+garubin@users.noreply.github.com> Co-authored-by: Theodore Chang Co-authored-by: xielexie <94083876+xielexie@users.noreply.github.com> Co-authored-by: Mike Richmond Co-authored-by: Avinash Akka Co-authored-by: ms-saypaul <67093296+ms-saypaul@users.noreply.github.com> Co-authored-by: Raktima Das Co-authored-by: kamusta-msft <56413142+kamusta-msft@users.noreply.github.com> Co-authored-by: frank-pang-msft <92764154+frank-pang-msft@users.noreply.github.com> Co-authored-by: Chase VanBuskirk Co-authored-by: Chase Van Buskirk Co-authored-by: vbhasker-msft <93355049+vbhasker-msft@users.noreply.github.com> Co-authored-by: avjai <34567499+avjai@users.noreply.github.com> Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Co-authored-by: karthikka4820 <88366202+karthikka4820@users.noreply.github.com> Co-authored-by: LexieXie Co-authored-by: john35452 Co-authored-by: John Lai Co-authored-by: evaou Co-authored-by: XField <58103249+vxfield@users.noreply.github.com> Co-authored-by: XField Co-authored-by: vighatke <91312614+vighatke@users.noreply.github.com> Co-authored-by: Levi Herpel <81385520+leherpel@users.noreply.github.com> Co-authored-by: Prachetos Sadhukhan Co-authored-by: apraovjr Co-authored-by: jago2136 <42753636+jago2136@users.noreply.github.com> Co-authored-by: Jared Gorthy Co-authored-by: Arpit Jain <46751982+arpja@users.noreply.github.com> Co-authored-by: Yash Jain <87814230+yashjain4@users.noreply.github.com> Co-authored-by: khmic5 <96520421+khmic5@users.noreply.github.com> Co-authored-by: Susan Shi Co-authored-by: Pratima Upadhyay Co-authored-by: Xunzhe Xu <46947162+x9xu@users.noreply.github.com> Co-authored-by: chcmsft <86343602+chcmsft@users.noreply.github.com> Co-authored-by: Jordan Rodak Co-authored-by: Ian <31246255+iancaragol@users.noreply.github.com> Co-authored-by: sanray-ms <76875901+sanray-ms@users.noreply.github.com> Co-authored-by: ruowan Co-authored-by: Daniel Hu Co-authored-by: LeiWang3 <84884417+LeiWang3@users.noreply.github.com> Co-authored-by: priyankarking Co-authored-by: Priyankar Gupta Co-authored-by: Guruprasad Veerannavaru <39453452+urguru@users.noreply.github.com> Co-authored-by: Mo Shaban Co-authored-by: Sebastian Herzig-Patel Co-authored-by: Nate Lehman Co-authored-by: Nate Lehman Co-authored-by: dorothyhu <72949285+dorothyhu@users.noreply.github.com> Co-authored-by: Aashish Rajaram Salokhe <40220544+aashish1987@users.noreply.github.com> Co-authored-by: Aashish Rajaram Salokhe Co-authored-by: Vidya Kukke Co-authored-by: Laurent Mazuel Co-authored-by: arpit-gagneja Co-authored-by: Arpit Gagneja Co-authored-by: ShaniFelig <74960756+ShaniFelig@users.noreply.github.com> Co-authored-by: roherzbe <52486962+roherzbe@users.noreply.github.com> Co-authored-by: Igal Co-authored-by: Igal Shapira Co-authored-by: Ido Klotz Co-authored-by: Ido Klotz Co-authored-by: royrein <37300636+royrein@users.noreply.github.com> Co-authored-by: Roy Reinhorn Co-authored-by: lilyanc02 <46589651+lilyanc02@users.noreply.github.com> Co-authored-by: Lilyan Cohen Co-authored-by: Vishal Kumar Co-authored-by: agalerrotaru <86316103+agalerrotaru@users.noreply.github.com> Co-authored-by: Lingling Tong Co-authored-by: Or Parnes Co-authored-by: Zhuofu Deng Co-authored-by: saipv Co-authored-by: Mary Gao Co-authored-by: Andrew Sager Co-authored-by: zhenqxuMSFT Co-authored-by: Yanming Tang Co-authored-by: FumingZhang <81607949+FumingZhang@users.noreply.github.com> Co-authored-by: Matt Stam Co-authored-by: Tongyao Si Co-authored-by: Jianping Zeng Co-authored-by: Jianping Zeng --- .../azure-mgmt-costmanagement/_meta.json | 10 +- .../azure/mgmt/costmanagement/__init__.py | 9 +- .../mgmt/costmanagement/_configuration.py | 26 +- .../costmanagement/_cost_management_client.py | 140 +- .../azure/mgmt/costmanagement/_metadata.json | 33 +- .../azure/mgmt/costmanagement/_patch.py | 31 + .../azure/mgmt/costmanagement/_vendor.py | 27 + .../azure/mgmt/costmanagement/_version.py | 2 +- .../azure/mgmt/costmanagement/aio/__init__.py | 5 + .../mgmt/costmanagement/aio/_configuration.py | 15 +- .../aio/_cost_management_client.py | 128 +- .../azure/mgmt/costmanagement/aio/_patch.py | 31 + .../costmanagement/aio/operations/__init__.py | 12 +- .../aio/operations/_alerts_operations.py | 199 +- .../aio/operations/_dimensions_operations.py | 189 +- .../aio/operations/_exports_operations.py | 314 +-- .../aio/operations/_forecast_operations.py | 132 +- ...ost_report_operation_results_operations.py | 117 + ...cost_report_operation_status_operations.py | 115 + ...enerate_detailed_cost_report_operations.py | 189 ++ ...e_reservation_details_report_operations.py | 166 +- .../aio/operations/_operations.py | 61 +- .../aio/operations/_query_operations.py | 122 +- .../aio/operations/_settings_operations.py | 273 -- .../aio/operations/_views_operations.py | 390 +-- .../mgmt/costmanagement/models/__init__.py | 201 +- .../models/_cost_management_client_enums.py | 134 +- .../mgmt/costmanagement/models/_models.py | 2225 ---------------- .../mgmt/costmanagement/models/_models_py3.py | 2253 +++++++++++------ .../costmanagement/operations/__init__.py | 12 +- .../operations/_alerts_operations.py | 389 ++- .../operations/_dimensions_operations.py | 316 ++- .../operations/_exports_operations.py | 602 +++-- .../operations/_forecast_operations.py | 252 +- ...ost_report_operation_results_operations.py | 154 ++ ...cost_report_operation_status_operations.py | 152 ++ ...enerate_detailed_cost_report_operations.py | 233 ++ ...e_reservation_details_report_operations.py | 301 ++- .../costmanagement/operations/_operations.py | 100 +- .../operations/_query_operations.py | 232 +- .../operations/_settings_operations.py | 281 -- .../operations/_views_operations.py | 735 ++++-- 42 files changed, 5742 insertions(+), 5566 deletions(-) create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_patch.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_patch.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py delete mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py delete mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py create mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py delete mode 100644 sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json index 8041e01d515b..2126bd5d5934 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.13.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "74efe54fbc55c91a1d9213afbb2723747acfddf9", + "commit": "f92aaf88f4c9d1ffb9a014eba196d887a9288c3a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/cost-management/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/cost-management/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py index 0e26ee2701fe..b76c817829ba 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['CostManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py index 0cd20f8ef97a..0a7eae5dd335 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_configuration.py @@ -6,22 +6,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential -class CostManagementClientConfiguration(Configuration): +class CostManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for CostManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,20 +27,24 @@ class CostManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( self, - credential, # type: "TokenCredential" - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + **kwargs: Any + ) -> None: + super(CostManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) self._configure(**kwargs) @@ -62,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py index 521cb5222a88..0fa7365b24e0 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_cost_management_client.py @@ -6,36 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING -from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient -from ._configuration import CostManagementClientConfiguration -from .operations import SettingsOperations -from .operations import ViewsOperations -from .operations import AlertsOperations -from .operations import ForecastOperations -from .operations import DimensionsOperations -from .operations import QueryOperations -from .operations import GenerateReservationDetailsReportOperations -from .operations import Operations -from .operations import ExportsOperations from . import models +from ._configuration import CostManagementClientConfiguration +from .operations import AlertsOperations, DimensionsOperations, ExportsOperations, ForecastOperations, GenerateDetailedCostReportOperationResultsOperations, GenerateDetailedCostReportOperationStatusOperations, GenerateDetailedCostReportOperations, GenerateReservationDetailsReportOperations, Operations, QueryOperations, ViewsOperations +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential -class CostManagementClient(object): +class CostManagementClient: # pylint: disable=too-many-instance-attributes """CostManagementClient. - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.costmanagement.operations.SettingsOperations + :ivar exports: ExportsOperations operations + :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations + :ivar generate_detailed_cost_report: GenerateDetailedCostReportOperations operations + :vartype generate_detailed_cost_report: + azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperations + :ivar generate_detailed_cost_report_operation_results: + GenerateDetailedCostReportOperationResultsOperations operations + :vartype generate_detailed_cost_report_operation_results: + azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationResultsOperations + :ivar generate_detailed_cost_report_operation_status: + GenerateDetailedCostReportOperationStatusOperations operations + :vartype generate_detailed_cost_report_operation_status: + azure.mgmt.costmanagement.operations.GenerateDetailedCostReportOperationStatusOperations :ivar views: ViewsOperations operations :vartype views: azure.mgmt.costmanagement.operations.ViewsOperations :ivar alerts: AlertsOperations operations @@ -46,68 +48,74 @@ class CostManagementClient(object): :vartype dimensions: azure.mgmt.costmanagement.operations.DimensionsOperations :ivar query: QueryOperations operations :vartype query: azure.mgmt.costmanagement.operations.QueryOperations - :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations - :vartype generate_reservation_details_report: azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations + :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations + operations + :vartype generate_reservation_details_report: + azure.mgmt.costmanagement.operations.GenerateReservationDetailsReportOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.operations.Operations - :ivar exports: ExportsOperations operations - :vartype exports: azure.mgmt.costmanagement.operations.ExportsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, - credential, # type: "TokenCredential" - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = CostManagementClientConfiguration(credential, **kwargs) + credential: "TokenCredential", + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = CostManagementClientConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.views = ViewsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.forecast = ForecastOperations( - self._client, self._config, self._serialize, self._deserialize) - self.dimensions = DimensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.query = QueryOperations( - self._client, self._config, self._serialize, self._deserialize) - self.generate_reservation_details_report = GenerateReservationDetailsReportOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.exports = ExportsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + self._serialize.client_side_validation = False + self.exports = ExportsOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report = GenerateDetailedCostReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report_operation_results = GenerateDetailedCostReportOperationResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize) + self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize) + self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - http_request.url = self._client.format_url(http_request.url) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json index 1e323f28f6ac..5c52b616de44 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2019-11-01", - "total_api_version_list": ["2019-11-01"], + "chosen_version": "2021-10-01", + "total_api_version_list": ["2021-10-01"], "client": { "name": "CostManagementClient", "filename": "_cost_management_client", "description": "CostManagementClient.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CostManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -42,7 +42,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -62,7 +62,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -79,21 +79,22 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { - "settings": "SettingsOperations", + "exports": "ExportsOperations", + "generate_detailed_cost_report": "GenerateDetailedCostReportOperations", + "generate_detailed_cost_report_operation_results": "GenerateDetailedCostReportOperationResultsOperations", + "generate_detailed_cost_report_operation_status": "GenerateDetailedCostReportOperationStatusOperations", "views": "ViewsOperations", "alerts": "AlertsOperations", "forecast": "ForecastOperations", "dimensions": "DimensionsOperations", "query": "QueryOperations", "generate_reservation_details_report": "GenerateReservationDetailsReportOperations", - "operations": "Operations", - "exports": "ExportsOperations" + "operations": "Operations" } } \ No newline at end of file diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_patch.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# 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 is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py index 7dec206f98a6..b07c11ae6b2c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/__init__.py @@ -8,3 +8,8 @@ from ._cost_management_client import CostManagementClient __all__ = ['CostManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py index 22c0705a007a..09229a06afb0 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class CostManagementClientConfiguration(Configuration): +class CostManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for CostManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,6 +27,9 @@ class CostManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -34,12 +37,14 @@ def __init__( credential: "AsyncTokenCredential", **kwargs: Any ) -> None: + super(CostManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(CostManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential - self.api_version = "2019-11-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-costmanagement/{}'.format(VERSION)) self._configure(**kwargs) @@ -58,4 +63,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py index ab4f0f5bdab7..7807a6d6b9fb 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_cost_management_client.py @@ -6,34 +6,38 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient -from ._configuration import CostManagementClientConfiguration -from .operations import SettingsOperations -from .operations import ViewsOperations -from .operations import AlertsOperations -from .operations import ForecastOperations -from .operations import DimensionsOperations -from .operations import QueryOperations -from .operations import GenerateReservationDetailsReportOperations -from .operations import Operations -from .operations import ExportsOperations from .. import models +from ._configuration import CostManagementClientConfiguration +from .operations import AlertsOperations, DimensionsOperations, ExportsOperations, ForecastOperations, GenerateDetailedCostReportOperationResultsOperations, GenerateDetailedCostReportOperationStatusOperations, GenerateDetailedCostReportOperations, GenerateReservationDetailsReportOperations, Operations, QueryOperations, ViewsOperations +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential -class CostManagementClient(object): +class CostManagementClient: # pylint: disable=too-many-instance-attributes """CostManagementClient. - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.costmanagement.aio.operations.SettingsOperations + :ivar exports: ExportsOperations operations + :vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations + :ivar generate_detailed_cost_report: GenerateDetailedCostReportOperations operations + :vartype generate_detailed_cost_report: + azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperations + :ivar generate_detailed_cost_report_operation_results: + GenerateDetailedCostReportOperationResultsOperations operations + :vartype generate_detailed_cost_report_operation_results: + azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperationResultsOperations + :ivar generate_detailed_cost_report_operation_status: + GenerateDetailedCostReportOperationStatusOperations operations + :vartype generate_detailed_cost_report_operation_status: + azure.mgmt.costmanagement.aio.operations.GenerateDetailedCostReportOperationStatusOperations :ivar views: ViewsOperations operations :vartype views: azure.mgmt.costmanagement.aio.operations.ViewsOperations :ivar alerts: AlertsOperations operations @@ -44,66 +48,74 @@ class CostManagementClient(object): :vartype dimensions: azure.mgmt.costmanagement.aio.operations.DimensionsOperations :ivar query: QueryOperations operations :vartype query: azure.mgmt.costmanagement.aio.operations.QueryOperations - :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations operations - :vartype generate_reservation_details_report: azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations + :ivar generate_reservation_details_report: GenerateReservationDetailsReportOperations + operations + :vartype generate_reservation_details_report: + azure.mgmt.costmanagement.aio.operations.GenerateReservationDetailsReportOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.costmanagement.aio.operations.Operations - :ivar exports: ExportsOperations operations - :vartype exports: azure.mgmt.costmanagement.aio.operations.ExportsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2021-10-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = CostManagementClientConfiguration(credential, **kwargs) + self._config = CostManagementClientConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.exports = ExportsOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report = GenerateDetailedCostReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report_operation_results = GenerateDetailedCostReportOperationResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_detailed_cost_report_operation_status = GenerateDetailedCostReportOperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.views = ViewsOperations(self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize) + self.forecast = ForecastOperations(self._client, self._config, self._serialize, self._deserialize) + self.dimensions = DimensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.query = QueryOperations(self._client, self._config, self._serialize, self._deserialize) + self.generate_reservation_details_report = GenerateReservationDetailsReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.views = ViewsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.forecast = ForecastOperations( - self._client, self._config, self._serialize, self._deserialize) - self.dimensions = DimensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.query = QueryOperations( - self._client, self._config, self._serialize, self._deserialize) - self.generate_reservation_details_report = GenerateReservationDetailsReportOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.exports = ExportsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - http_request.url = self._client.format_url(http_request.url) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_patch.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# 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 is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py index c70a4cb564cb..7f864e537b31 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/__init__.py @@ -6,7 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._settings_operations import SettingsOperations +from ._exports_operations import ExportsOperations +from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations +from ._generate_detailed_cost_report_operation_results_operations import GenerateDetailedCostReportOperationResultsOperations +from ._generate_detailed_cost_report_operation_status_operations import GenerateDetailedCostReportOperationStatusOperations from ._views_operations import ViewsOperations from ._alerts_operations import AlertsOperations from ._forecast_operations import ForecastOperations @@ -14,10 +17,12 @@ from ._query_operations import QueryOperations from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations from ._operations import Operations -from ._exports_operations import ExportsOperations __all__ = [ - 'SettingsOperations', + 'ExportsOperations', + 'GenerateDetailedCostReportOperations', + 'GenerateDetailedCostReportOperationResultsOperations', + 'GenerateDetailedCostReportOperationStatusOperations', 'ViewsOperations', 'AlertsOperations', 'ForecastOperations', @@ -25,5 +30,4 @@ 'QueryOperations', 'GenerateReservationDetailsReportOperations', 'Operations', - 'ExportsOperations', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py index 216d5ebc7b21..16fbb563a06c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_alerts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._alerts_operations import build_dismiss_request, build_get_request, build_list_external_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, scope: str, @@ -74,31 +78,28 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_request( + scope=scope, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsResult', pipeline_response) @@ -107,8 +108,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts"} # type: ignore + + + @distributed_trace_async async def get( self, scope: str, @@ -146,32 +150,29 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + scope=scope, + alert_id=alert_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -180,8 +181,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + + + @distributed_trace_async async def dismiss( self, scope: str, @@ -222,37 +226,33 @@ async def dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.dismiss.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DismissAlertPayload') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DismissAlertPayload') + + request = build_dismiss_request( + scope=scope, + alert_id=alert_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.dismiss.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -261,8 +261,11 @@ async def dismiss( return cls(pipeline_response, deserialized, {}) return deserialized - dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + dismiss.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + + + @distributed_trace_async async def list_external( self, external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], @@ -274,7 +277,8 @@ async def list_external( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -288,32 +292,29 @@ async def list_external( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_external.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_external_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + template_url=self.list_external.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsResult', pipeline_response) @@ -322,4 +323,6 @@ async def list_external( return cls(pipeline_response, deserialized, {}) return deserialized - list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} # type: ignore + + list_external.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py index 090f2e992e2d..97fc701a6e52 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_dimensions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,17 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._dimensions_operations import build_by_external_cloud_provider_type_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, scope: str, @@ -70,63 +74,67 @@ def list( specific for partners. :type scope: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, - properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. Default value is + None. :type filter: str :param expand: May be used to expand the properties/data within a dimension category. By - default, data is not included when listing dimensions. + default, data is not included when listing dimensions. Default value is None. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include - a skiptoken parameter that specifies a starting point to use for subsequent calls. + a skiptoken parameter that specifies a starting point to use for subsequent calls. Default + value is None. :type skiptoken: str :param top: May be used to limit the number of results to the most recent N dimension data. + Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DimensionsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResultor None] + :return: An iterator like instance of either DimensionsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + scope=scope, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + scope=scope, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('DimensionsListResult', pipeline_response) + deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -135,21 +143,27 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/dimensions"} # type: ignore + @distributed_trace def by_external_cloud_provider_type( self, external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], @@ -165,69 +179,75 @@ def by_external_cloud_provider_type( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, - properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. Default value is + None. :type filter: str :param expand: May be used to expand the properties/data within a dimension category. By - default, data is not included when listing dimensions. + default, data is not included when listing dimensions. Default value is None. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include - a skiptoken parameter that specifies a starting point to use for subsequent calls. + a skiptoken parameter that specifies a starting point to use for subsequent calls. Default + value is None. :type skiptoken: str :param top: May be used to limit the number of results to the most recent N dimension data. + Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DimensionsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] + :return: An iterator like instance of either DimensionsListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.by_external_cloud_provider_type.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=self.by_external_cloud_provider_type.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('DimensionsListResult', pipeline_response) + deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -236,17 +256,22 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} # type: ignore + by_external_cloud_provider_type.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py index 2f3497eee08b..9598d54caa4e 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_exports_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._exports_operations import build_create_or_update_request, build_delete_request, build_execute_request, build_get_execution_history_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,14 +43,16 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, scope: str, + expand: Optional[str] = None, **kwargs: Any ) -> "_models.ExportListResult": """The operation to list all exports at the given scope. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -64,6 +69,10 @@ async def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + Default value is None. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExportListResult, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.ExportListResult @@ -74,31 +83,29 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_request( + scope=scope, + api_version=api_version, + expand=expand, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExportListResult', pipeline_response) @@ -107,17 +114,21 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports"} # type: ignore + + + @distributed_trace_async async def get( self, scope: str, export_name: str, + expand: Optional[str] = None, **kwargs: Any ) -> "_models.Export": """The operation to get the export for the defined scope by export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -136,6 +147,10 @@ async def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + Default value is None. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Export, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.Export @@ -146,32 +161,30 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + scope=scope, + export_name=export_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Export', pipeline_response) @@ -180,8 +193,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + + + @distributed_trace_async async def create_or_update( self, scope: str, @@ -193,7 +209,7 @@ async def create_or_update( the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -224,37 +240,33 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Export') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Export') + + request = build_create_or_update_request( + scope=scope, + export_name=export_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -267,9 +279,12 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore - async def delete( + create_or_update.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, scope: str, export_name: str, @@ -277,7 +292,7 @@ async def delete( ) -> None: """The operation to delete a export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -306,48 +321,47 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_delete_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore + delete.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore - async def execute( + + @distributed_trace_async + async def execute( # pylint: disable=inconsistent-return-statements self, scope: str, export_name: str, **kwargs: Any ) -> None: - """The operation to execute a export. + """The operation to execute an export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -376,48 +390,47 @@ async def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.execute.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_execute_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.execute.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore + execute.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} # type: ignore + + @distributed_trace_async async def get_execution_history( self, scope: str, export_name: str, **kwargs: Any ) -> "_models.ExportExecutionListResult": - """The operation to get the execution history of an export for the defined scope by export name. + """The operation to get the execution history of an export for the defined scope and export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -446,32 +459,29 @@ async def get_execution_history( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_execution_history.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_execution_history_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.get_execution_history.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExportExecutionListResult', pipeline_response) @@ -480,4 +490,6 @@ async def get_execution_history( return cls(pipeline_response, deserialized, {}) return deserialized - get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} # type: ignore + + get_execution_history.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py index 8524f06621a5..672f3662bd2a 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_forecast_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._forecast_operations import build_external_cloud_provider_usage_request, build_usage_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def usage( self, scope: str, @@ -70,7 +74,7 @@ async def usage( :type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', - and 'and'. It does not currently support 'ne', 'or', or 'not'. + and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) @@ -82,38 +86,33 @@ async def usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ForecastDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ForecastDefinition') + + request = build_usage_request( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + filter=filter, + template_url=self.usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -124,8 +123,11 @@ async def usage( return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore + usage.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/forecast"} # type: ignore + + + @distributed_trace_async async def external_cloud_provider_usage( self, external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], @@ -139,7 +141,8 @@ async def external_cloud_provider_usage( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -147,7 +150,7 @@ async def external_cloud_provider_usage( :type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', - and 'and'. It does not currently support 'ne', 'or', or 'not'. + and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) @@ -159,39 +162,34 @@ async def external_cloud_provider_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.external_cloud_provider_usage.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ForecastDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ForecastDefinition') + + request = build_external_cloud_provider_usage_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + content_type=content_type, + json=_json, + filter=filter, + template_url=self.external_cloud_provider_usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('QueryResult', pipeline_response) @@ -200,4 +198,6 @@ async def external_cloud_provider_usage( return cls(pipeline_response, deserialized, {}) return deserialized - external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} # type: ignore + + external_cloud_provider_usage.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py new file mode 100644 index 000000000000..8927635fbe4c --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_results_operations.py @@ -0,0 +1,117 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._generate_detailed_cost_report_operation_results_operations import build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GenerateDetailedCostReportOperationResultsOperations: + """GenerateDetailedCostReportOperationResultsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + operation_id: str, + scope: str, + **kwargs: Any + ) -> Optional["_models.GenerateDetailedCostReportOperationResult"]: + """Get the result of the specified operation. This link is provided in the + GenerateDetailedCostReport creation request response header. + + :param operation_id: The target operation Id. + :type operation_id: str + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateDetailedCostReportOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GenerateDetailedCostReportOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + operation_id=operation_id, + scope=scope, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py new file mode 100644 index 000000000000..9f1c46c77227 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operation_status_operations.py @@ -0,0 +1,115 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._generate_detailed_cost_report_operation_status_operations import build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GenerateDetailedCostReportOperationStatusOperations: + """GenerateDetailedCostReportOperationStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + operation_id: str, + scope: str, + **kwargs: Any + ) -> "_models.GenerateDetailedCostReportOperationStatuses": + """Get the status of the specified operation. This link is provided in the + GenerateDetailedCostReport creation request response header. + + :param operation_id: The target operation Id. + :type operation_id: str + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateDetailedCostReportOperationStatuses, or the result of cls(response) + :rtype: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationStatuses + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateDetailedCostReportOperationStatuses"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + operation_id=operation_id, + scope=scope, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateDetailedCostReportOperationStatuses', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py new file mode 100644 index 000000000000..7712202285ac --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_detailed_cost_report_operations.py @@ -0,0 +1,189 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._generate_detailed_cost_report_operations import build_create_operation_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GenerateDetailedCostReportOperations: + """GenerateDetailedCostReportOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_operation_initial( + self, + scope: str, + parameters: "_models.GenerateDetailedCostReportDefinition", + **kwargs: Any + ) -> Optional["_models.GenerateDetailedCostReportOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GenerateDetailedCostReportOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'GenerateDetailedCostReportDefinition') + + request = build_create_operation_request_initial( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_operation_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-Consumption-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-Consumption-AsyncOperation')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _create_operation_initial.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + + + @distributed_trace_async + async def begin_create_operation( + self, + scope: str, + parameters: "_models.GenerateDetailedCostReportDefinition", + **kwargs: Any + ) -> AsyncLROPoller["_models.GenerateDetailedCostReportOperationResult"]: + """Generates the detailed cost report for provided date range, billing period(Only enterprise + customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header + Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the + operation will provide the status and if the operation is completed the blob file where + generated detailed cost report is being stored. + + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param parameters: Parameters supplied to the Create detailed cost report operation. + :type parameters: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportDefinition + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + GenerateDetailedCostReportOperationResult or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateDetailedCostReportOperationResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_operation_initial( + scope=scope, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_operation.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py index 04654269eb88..7e2e356e8413 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_generate_reservation_details_report_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,18 +6,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._generate_reservation_details_report_operations import build_by_billing_account_id_request_initial, build_by_billing_profile_id_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,50 +57,50 @@ async def _by_billing_account_id_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_account_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_by_billing_account_id_request_initial( + billing_account_id=billing_account_id, + api_version=api_version, + start_date=start_date, + end_date=end_date, + template_url=self._by_billing_account_id_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationStatus', pipeline_response) if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _by_billing_account_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + _by_billing_account_id_initial.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + + + @distributed_trace_async async def begin_by_billing_account_id( self, billing_account_id: str, @@ -116,14 +119,18 @@ async def begin_by_billing_account_id( :type end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( @@ -136,25 +143,21 @@ async def begin_by_billing_account_id( billing_account_id=billing_account_id, start_date=start_date, end_date=end_date, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -164,9 +167,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_by_billing_account_id.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore async def _by_billing_profile_id_initial( self, @@ -181,51 +184,51 @@ async def _by_billing_profile_id_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_profile_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_by_billing_profile_id_request_initial( + billing_account_id=billing_account_id, + billing_profile_id=billing_profile_id, + api_version=api_version, + start_date=start_date, + end_date=end_date, + template_url=self._by_billing_profile_id_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationStatus', pipeline_response) if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _by_billing_profile_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + _by_billing_profile_id_initial.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + + + @distributed_trace_async async def begin_by_billing_profile_id( self, billing_account_id: str, @@ -247,14 +250,18 @@ async def begin_by_billing_profile_id( :type end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( @@ -268,26 +275,21 @@ async def begin_by_billing_profile_id( billing_profile_id=billing_profile_id, start_date=start_date, end_date=end_date, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -297,6 +299,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_profile_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_by_billing_profile_id.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py index e9b536504b06..54d15227e8af 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,17 +6,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,38 +53,40 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.OperationListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,17 +95,22 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.CostManagement/operations"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py index 7a973c90e3c8..595182ec4926 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_query_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,16 +6,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._query_operations import build_usage_by_external_cloud_provider_type_request, build_usage_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def usage( self, scope: str, @@ -77,36 +81,32 @@ async def usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'QueryDefinition') + + request = build_usage_request( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -117,8 +117,11 @@ async def usage( return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore + usage.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/query"} # type: ignore + + + @distributed_trace_async async def usage_by_external_cloud_provider_type( self, external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], @@ -131,7 +134,8 @@ async def usage_by_external_cloud_provider_type( :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -147,37 +151,33 @@ async def usage_by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'QueryDefinition') + + request = build_usage_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.usage_by_external_cloud_provider_type.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('QueryResult', pipeline_response) @@ -186,4 +186,6 @@ async def usage_by_external_cloud_provider_type( return cls(pipeline_response, deserialized, {}) return deserialized - usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} # type: ignore + + usage_by_external_cloud_provider_type.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py deleted file mode 100644 index 2a0f8f9e272e..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_settings_operations.py +++ /dev/null @@ -1,273 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SettingsOperations: - """SettingsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SettingsListResult"]: - """Lists all of the settings that have been customized. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SettingsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.SettingsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SettingsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SettingsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/settings'} # type: ignore - - async def get( - self, - setting_name: str, - **kwargs: Any - ) -> "_models.Setting": - """Retrieves the current value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - async def create_or_update( - self, - setting_name: str, - parameters: "_models.Setting", - **kwargs: Any - ) -> "_models.Setting": - """Sets a new value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :param parameters: Body supplied to the CreateOrUpdate setting operation. - :type parameters: ~azure.mgmt.costmanagement.models.Setting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Setting') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - async def delete( - self, - setting_name: str, - **kwargs: Any - ) -> None: - """Remove the current value for a specific setting and reverts back to the default value, if - applicable. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py index a82f547d6103..348e05b23c7c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/aio/operations/_views_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,17 +6,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._views_operations import build_create_or_update_by_scope_request, build_create_or_update_request, build_delete_by_scope_request, build_delete_request, build_get_by_scope_request, build_get_request, build_list_by_scope_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -49,38 +54,40 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ViewListResult', pipeline_response) + deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -89,21 +96,27 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.CostManagement/views"} # type: ignore + @distributed_trace def list_by_scope( self, scope: str, @@ -131,42 +144,42 @@ def list_by_scope( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_scope_request( + scope=scope, + api_version=api_version, + template_url=self.list_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_scope_request( + scope=scope, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ViewListResult', pipeline_response) + deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -175,21 +188,27 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) - list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore + list_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views"} # type: ignore + @distributed_trace_async async def get( self, view_name: str, @@ -209,31 +228,28 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + view_name=view_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('View', pipeline_response) @@ -242,8 +258,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + get.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace_async async def create_or_update( self, view_name: str, @@ -268,36 +287,32 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'View') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'View') + + request = build_create_or_update_request( + view_name=view_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -310,9 +325,12 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore - async def delete( + create_or_update.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements self, view_name: str, **kwargs: Any @@ -331,38 +349,37 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + view_name=view_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + delete.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + @distributed_trace_async async def get_by_scope( self, scope: str, @@ -401,32 +418,29 @@ async def get_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + template_url=self.get_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('View', pipeline_response) @@ -435,8 +449,11 @@ async def get_by_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + get_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace_async async def create_or_update_by_scope( self, scope: str, @@ -480,37 +497,33 @@ async def create_or_update_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'View') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'View') + + request = build_create_or_update_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -523,9 +536,12 @@ async def create_or_update_by_scope( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore - async def delete_by_scope( + create_or_update_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace_async + async def delete_by_scope( # pylint: disable=inconsistent-return-statements self, scope: str, view_name: str, @@ -563,35 +579,33 @@ async def delete_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + template_url=self.delete_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + delete_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py index c55fa14a8390..a61cdbe6ccb1 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/__init__.py @@ -6,120 +6,66 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import Alert - from ._models_py3 import AlertPropertiesDefinition - from ._models_py3 import AlertPropertiesDetails - from ._models_py3 import AlertsResult - from ._models_py3 import CacheItem - from ._models_py3 import CommonExportProperties - from ._models_py3 import Dimension - from ._models_py3 import DimensionsListResult - from ._models_py3 import DismissAlertPayload - from ._models_py3 import ErrorDetails - from ._models_py3 import ErrorResponse - from ._models_py3 import Export - from ._models_py3 import ExportDefinition - from ._models_py3 import ExportDeliveryDestination - from ._models_py3 import ExportDeliveryInfo - from ._models_py3 import ExportExecution - from ._models_py3 import ExportExecutionListResult - from ._models_py3 import ExportListResult - from ._models_py3 import ExportProperties - from ._models_py3 import ExportRecurrencePeriod - from ._models_py3 import ExportSchedule - from ._models_py3 import ForecastDefinition - from ._models_py3 import KpiProperties - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import OperationStatus - from ._models_py3 import PivotProperties - from ._models_py3 import ProxyResource - from ._models_py3 import ProxySettingResource - from ._models_py3 import QueryAggregation - from ._models_py3 import QueryColumn - from ._models_py3 import QueryComparisonExpression - from ._models_py3 import QueryDataset - from ._models_py3 import QueryDatasetAutoGenerated - from ._models_py3 import QueryDatasetConfiguration - from ._models_py3 import QueryDefinition - from ._models_py3 import QueryFilter - from ._models_py3 import QueryFilterAutoGenerated - from ._models_py3 import QueryGrouping - from ._models_py3 import QueryResult - from ._models_py3 import QueryTimePeriod - from ._models_py3 import ReportConfigAggregation - from ._models_py3 import ReportConfigComparisonExpression - from ._models_py3 import ReportConfigDataset - from ._models_py3 import ReportConfigDatasetConfiguration - from ._models_py3 import ReportConfigFilter - from ._models_py3 import ReportConfigGrouping - from ._models_py3 import ReportConfigSorting - from ._models_py3 import ReportConfigTimePeriod - from ._models_py3 import Resource - from ._models_py3 import Setting - from ._models_py3 import SettingsListResult - from ._models_py3 import Status - from ._models_py3 import View - from ._models_py3 import ViewListResult -except (SyntaxError, ImportError): - from ._models import Alert # type: ignore - from ._models import AlertPropertiesDefinition # type: ignore - from ._models import AlertPropertiesDetails # type: ignore - from ._models import AlertsResult # type: ignore - from ._models import CacheItem # type: ignore - from ._models import CommonExportProperties # type: ignore - from ._models import Dimension # type: ignore - from ._models import DimensionsListResult # type: ignore - from ._models import DismissAlertPayload # type: ignore - from ._models import ErrorDetails # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import Export # type: ignore - from ._models import ExportDefinition # type: ignore - from ._models import ExportDeliveryDestination # type: ignore - from ._models import ExportDeliveryInfo # type: ignore - from ._models import ExportExecution # type: ignore - from ._models import ExportExecutionListResult # type: ignore - from ._models import ExportListResult # type: ignore - from ._models import ExportProperties # type: ignore - from ._models import ExportRecurrencePeriod # type: ignore - from ._models import ExportSchedule # type: ignore - from ._models import ForecastDefinition # type: ignore - from ._models import KpiProperties # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import OperationStatus # type: ignore - from ._models import PivotProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import ProxySettingResource # type: ignore - from ._models import QueryAggregation # type: ignore - from ._models import QueryColumn # type: ignore - from ._models import QueryComparisonExpression # type: ignore - from ._models import QueryDataset # type: ignore - from ._models import QueryDatasetAutoGenerated # type: ignore - from ._models import QueryDatasetConfiguration # type: ignore - from ._models import QueryDefinition # type: ignore - from ._models import QueryFilter # type: ignore - from ._models import QueryFilterAutoGenerated # type: ignore - from ._models import QueryGrouping # type: ignore - from ._models import QueryResult # type: ignore - from ._models import QueryTimePeriod # type: ignore - from ._models import ReportConfigAggregation # type: ignore - from ._models import ReportConfigComparisonExpression # type: ignore - from ._models import ReportConfigDataset # type: ignore - from ._models import ReportConfigDatasetConfiguration # type: ignore - from ._models import ReportConfigFilter # type: ignore - from ._models import ReportConfigGrouping # type: ignore - from ._models import ReportConfigSorting # type: ignore - from ._models import ReportConfigTimePeriod # type: ignore - from ._models import Resource # type: ignore - from ._models import Setting # type: ignore - from ._models import SettingsListResult # type: ignore - from ._models import Status # type: ignore - from ._models import View # type: ignore - from ._models import ViewListResult # type: ignore +from ._models_py3 import Alert +from ._models_py3 import AlertPropertiesDefinition +from ._models_py3 import AlertPropertiesDetails +from ._models_py3 import AlertsResult +from ._models_py3 import CommonExportProperties +from ._models_py3 import Dimension +from ._models_py3 import DimensionsListResult +from ._models_py3 import DismissAlertPayload +from ._models_py3 import ErrorDetails +from ._models_py3 import ErrorResponse +from ._models_py3 import Export +from ._models_py3 import ExportDataset +from ._models_py3 import ExportDatasetConfiguration +from ._models_py3 import ExportDefinition +from ._models_py3 import ExportDeliveryDestination +from ._models_py3 import ExportDeliveryInfo +from ._models_py3 import ExportExecution +from ._models_py3 import ExportExecutionListResult +from ._models_py3 import ExportListResult +from ._models_py3 import ExportProperties +from ._models_py3 import ExportRecurrencePeriod +from ._models_py3 import ExportSchedule +from ._models_py3 import ExportTimePeriod +from ._models_py3 import ForecastDataset +from ._models_py3 import ForecastDefinition +from ._models_py3 import GenerateDetailedCostReportDefinition +from ._models_py3 import GenerateDetailedCostReportErrorResponse +from ._models_py3 import GenerateDetailedCostReportOperationResult +from ._models_py3 import GenerateDetailedCostReportOperationStatuses +from ._models_py3 import GenerateDetailedCostReportTimePeriod +from ._models_py3 import KpiProperties +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import OperationStatus +from ._models_py3 import PivotProperties +from ._models_py3 import ProxyResource +from ._models_py3 import QueryAggregation +from ._models_py3 import QueryColumn +from ._models_py3 import QueryComparisonExpression +from ._models_py3 import QueryDataset +from ._models_py3 import QueryDatasetConfiguration +from ._models_py3 import QueryDefinition +from ._models_py3 import QueryFilter +from ._models_py3 import QueryGrouping +from ._models_py3 import QueryResult +from ._models_py3 import QueryTimePeriod +from ._models_py3 import ReportConfigAggregation +from ._models_py3 import ReportConfigComparisonExpression +from ._models_py3 import ReportConfigDataset +from ._models_py3 import ReportConfigDatasetConfiguration +from ._models_py3 import ReportConfigFilter +from ._models_py3 import ReportConfigGrouping +from ._models_py3 import ReportConfigSorting +from ._models_py3 import ReportConfigTimePeriod +from ._models_py3 import Resource +from ._models_py3 import Status +from ._models_py3 import View +from ._models_py3 import ViewListResult + from ._cost_management_client_enums import ( AccumulatedType, @@ -139,6 +85,7 @@ ForecastType, FormatType, FunctionType, + GenerateDetailedCostReportMetricType, GranularityType, KpiType, MetricType, @@ -146,13 +93,14 @@ OperatorType, PivotType, QueryColumnType, + QueryOperatorType, RecurrenceType, ReportConfigColumnType, - ReportConfigSortingDirection, + ReportConfigSortingType, ReportGranularityType, + ReportOperationStatusType, ReportTimeframeType, ReportType, - SettingsPropertiesStartOn, StatusType, TimeframeType, ) @@ -162,7 +110,6 @@ 'AlertPropertiesDefinition', 'AlertPropertiesDetails', 'AlertsResult', - 'CacheItem', 'CommonExportProperties', 'Dimension', 'DimensionsListResult', @@ -170,6 +117,8 @@ 'ErrorDetails', 'ErrorResponse', 'Export', + 'ExportDataset', + 'ExportDatasetConfiguration', 'ExportDefinition', 'ExportDeliveryDestination', 'ExportDeliveryInfo', @@ -179,7 +128,14 @@ 'ExportProperties', 'ExportRecurrencePeriod', 'ExportSchedule', + 'ExportTimePeriod', + 'ForecastDataset', 'ForecastDefinition', + 'GenerateDetailedCostReportDefinition', + 'GenerateDetailedCostReportErrorResponse', + 'GenerateDetailedCostReportOperationResult', + 'GenerateDetailedCostReportOperationStatuses', + 'GenerateDetailedCostReportTimePeriod', 'KpiProperties', 'Operation', 'OperationDisplay', @@ -187,16 +143,13 @@ 'OperationStatus', 'PivotProperties', 'ProxyResource', - 'ProxySettingResource', 'QueryAggregation', 'QueryColumn', 'QueryComparisonExpression', 'QueryDataset', - 'QueryDatasetAutoGenerated', 'QueryDatasetConfiguration', 'QueryDefinition', 'QueryFilter', - 'QueryFilterAutoGenerated', 'QueryGrouping', 'QueryResult', 'QueryTimePeriod', @@ -209,8 +162,6 @@ 'ReportConfigSorting', 'ReportConfigTimePeriod', 'Resource', - 'Setting', - 'SettingsListResult', 'Status', 'View', 'ViewListResult', @@ -231,6 +182,7 @@ 'ForecastType', 'FormatType', 'FunctionType', + 'GenerateDetailedCostReportMetricType', 'GranularityType', 'KpiType', 'MetricType', @@ -238,13 +190,14 @@ 'OperatorType', 'PivotType', 'QueryColumnType', + 'QueryOperatorType', 'RecurrenceType', 'ReportConfigColumnType', - 'ReportConfigSortingDirection', + 'ReportConfigSortingType', 'ReportGranularityType', + 'ReportOperationStatusType', 'ReportTimeframeType', 'ReportType', - 'SettingsPropertiesStartOn', 'StatusType', 'TimeframeType', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py index eac0fd7748ff..ec3a8bd16218 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_cost_management_client_enums.py @@ -6,34 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AccumulatedType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AccumulatedType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Show costs accumulated over time. """ TRUE = "true" FALSE = "false" -class AlertCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Alert category """ @@ -42,7 +27,7 @@ class AlertCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): BILLING = "Billing" SYSTEM = "System" -class AlertCriteria(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertCriteria(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Criteria that triggered alert """ @@ -61,7 +46,7 @@ class AlertCriteria(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CROSS_CLOUD_COLLECTION_ERROR = "CrossCloudCollectionError" GENERAL_THRESHOLD_ERROR = "GeneralThresholdError" -class AlertOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertOperator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """operator used to compare currentSpend with amount """ @@ -72,14 +57,14 @@ class AlertOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LESS_THAN = "LessThan" LESS_THAN_OR_EQUAL_TO = "LessThanOrEqualTo" -class AlertSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Source of alert """ PRESET = "Preset" USER = "User" -class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """alert status """ @@ -89,7 +74,7 @@ class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESOLVED = "Resolved" DISMISSED = "Dismissed" -class AlertTimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertTimeGrainType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Type of timegrain cadence """ @@ -101,7 +86,7 @@ class AlertTimeGrainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): BILLING_QUARTER = "BillingQuarter" BILLING_ANNUAL = "BillingAnnual" -class AlertType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlertType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """type of alert """ @@ -113,7 +98,7 @@ class AlertType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): X_CLOUD = "xCloud" BUDGET_FORECAST = "BudgetForecast" -class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ChartType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Chart type of the main view in Cost Analysis. Required. """ @@ -123,8 +108,8 @@ class ChartType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): GROUPED_COLUMN = "GroupedColumn" TABLE = "Table" -class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the export execution. +class ExecutionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The last known status of the export execution. """ QUEUED = "Queued" @@ -135,27 +120,28 @@ class ExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NEW_DATA_NOT_AVAILABLE = "NewDataNotAvailable" DATA_NOT_AVAILABLE = "DataNotAvailable" -class ExecutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExecutionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the export execution. """ ON_DEMAND = "OnDemand" SCHEDULED = "Scheduled" -class ExportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of the query. +class ExportType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to + exports that do not yet provide data for charges or amortization for service reservations. """ USAGE = "Usage" ACTUAL_COST = "ActualCost" AMORTIZED_COST = "AmortizedCost" -class ExternalCloudProviderType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExternalCloudProviderType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): EXTERNAL_SUBSCRIPTIONS = "externalSubscriptions" EXTERNAL_BILLING_ACCOUNTS = "externalBillingAccounts" -class ForecastTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ForecastTimeframeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. """ @@ -167,7 +153,7 @@ class ForecastTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) WEEK_TO_DATE = "WeekToDate" CUSTOM = "Custom" -class ForecastType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ForecastType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the forecast. """ @@ -175,35 +161,39 @@ class ForecastType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACTUAL_COST = "ActualCost" AMORTIZED_COST = "AmortizedCost" -class FormatType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The format of the export being delivered. +class FormatType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The format of the export being delivered. Currently only 'Csv' is supported. """ CSV = "Csv" -class FunctionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class FunctionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The name of the aggregation function to use. """ - AVG = "Avg" - MAX = "Max" - MIN = "Min" SUM = "Sum" -class GranularityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The granularity of rows in the query. +class GenerateDetailedCostReportMetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of the detailed report. By default ActualCost is provided + """ + + ACTUAL_COST = "ActualCost" + AMORTIZED_COST = "AmortizedCost" + +class GranularityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The granularity of rows in the export. Currently only 'Daily' is supported. """ DAILY = "Daily" -class KpiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class KpiType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """KPI type (Forecast, Budget). """ FORECAST = "Forecast" BUDGET = "Budget" -class MetricType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MetricType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Metric to use when displaying costs. """ @@ -211,7 +201,7 @@ class MetricType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AMORTIZED_COST = "AmortizedCost" AHUB = "AHUB" -class OperationStatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OperationStatusType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The status of the long running operation. """ @@ -219,28 +209,34 @@ class OperationStatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COMPLETED = "Completed" FAILED = "Failed" -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The operator to use for comparison. """ IN_ENUM = "In" CONTAINS = "Contains" -class PivotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PivotType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Data type to show in view. """ DIMENSION = "Dimension" TAG_KEY = "TagKey" -class QueryColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class QueryColumnType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the column in the export. """ TAG = "Tag" DIMENSION = "Dimension" -class RecurrenceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class QueryOperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The operator to use for comparison. + """ + + IN_ENUM = "In" + +class RecurrenceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The schedule recurrence. """ @@ -249,28 +245,40 @@ class RecurrenceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MONTHLY = "Monthly" ANNUALLY = "Annually" -class ReportConfigColumnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReportConfigColumnType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the column in the report. """ TAG = "Tag" DIMENSION = "Dimension" -class ReportConfigSortingDirection(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReportConfigSortingType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Direction of sort. """ ASCENDING = "Ascending" DESCENDING = "Descending" -class ReportGranularityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReportGranularityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The granularity of rows in the report. """ DAILY = "Daily" MONTHLY = "Monthly" -class ReportTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReportOperationStatusType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The status of the long running operation. + """ + + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + QUEUED = "Queued" + NO_DATA_FOUND = "NoDataFound" + READY_TO_DOWNLOAD = "ReadyToDownload" + TIMED_OUT = "TimedOut" + +class ReportTimeframeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The time frame for pulling data for the report. If custom, then a specific time period must be provided. """ @@ -280,7 +288,7 @@ class ReportTimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): YEAR_TO_DATE = "YearToDate" CUSTOM = "Custom" -class ReportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReportType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. @@ -288,25 +296,15 @@ class ReportType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USAGE = "Usage" -class SettingsPropertiesStartOn(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates what scope Cost Management in the Azure portal should default to. Allowed values: - LastUsed. - """ - - LAST_USED = "LastUsed" - SCOPE_PICKER = "ScopePicker" - SPECIFIC_SCOPE = "SpecificScope" - -class StatusType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the schedule. Whether active or not. If inactive, the export's scheduled - execution is paused. +class StatusType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The status of the export's schedule. If 'Inactive', the export's schedule is paused. """ ACTIVE = "Active" INACTIVE = "Inactive" -class TimeframeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The time frame for pulling data for the query. If custom, then a specific time period must be +class TimeframeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The time frame for pulling data for the export. If custom, then a specific time period must be provided. """ diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py deleted file mode 100644 index ffd3292fd2df..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models.py +++ /dev/null @@ -1,2225 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.tags = None - - -class Alert(Resource): - """An individual alert. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition - :param description: Alert description. - :type description: str - :param source: Source of alert. Possible values include: "Preset", "User". - :type source: str or ~azure.mgmt.costmanagement.models.AlertSource - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails - :param cost_entity_id: related budget. - :type cost_entity_id: str - :param status: alert status. Possible values include: "None", "Active", "Overridden", - "Resolved", "Dismissed". - :type status: str or ~azure.mgmt.costmanagement.models.AlertStatus - :param creation_time: dateTime in which alert was created. - :type creation_time: str - :param close_time: dateTime in which alert was closed. - :type close_time: str - :param modification_time: dateTime in which alert was last modified. - :type modification_time: str - :param status_modification_user_name: - :type status_modification_user_name: str - :param status_modification_time: dateTime in which the alert status was last modified. - :type status_modification_time: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'details': {'key': 'properties.details', 'type': 'AlertPropertiesDetails'}, - 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, - 'close_time': {'key': 'properties.closeTime', 'type': 'str'}, - 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, - 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, - 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Alert, self).__init__(**kwargs) - self.definition = kwargs.get('definition', None) - self.description = kwargs.get('description', None) - self.source = kwargs.get('source', None) - self.details = kwargs.get('details', None) - self.cost_entity_id = kwargs.get('cost_entity_id', None) - self.status = kwargs.get('status', None) - self.creation_time = kwargs.get('creation_time', None) - self.close_time = kwargs.get('close_time', None) - self.modification_time = kwargs.get('modification_time', None) - self.status_modification_user_name = kwargs.get('status_modification_user_name', None) - self.status_modification_time = kwargs.get('status_modification_time', None) - - -class AlertPropertiesDefinition(msrest.serialization.Model): - """defines the type of alert. - - :param type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", - "General", "xCloud", "BudgetForecast". - :type type: str or ~azure.mgmt.costmanagement.models.AlertType - :param category: Alert category. Possible values include: "Cost", "Usage", "Billing", "System". - :type category: str or ~azure.mgmt.costmanagement.models.AlertCategory - :param criteria: Criteria that triggered alert. Possible values include: - "CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", - "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", - "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", - "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", - "CrossCloudCollectionError", "GeneralThresholdError". - :type criteria: str or ~azure.mgmt.costmanagement.models.AlertCriteria - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'criteria': {'key': 'criteria', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertPropertiesDefinition, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.category = kwargs.get('category', None) - self.criteria = kwargs.get('criteria', None) - - -class AlertPropertiesDetails(msrest.serialization.Model): - """Alert details. - - :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", - "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". - :type time_grain_type: str or ~azure.mgmt.costmanagement.models.AlertTimeGrainType - :param period_start_date: datetime of periodStartDate. - :type period_start_date: str - :param triggered_by: notificationId that triggered this alert. - :type triggered_by: str - :param resource_group_filter: array of resourceGroups to filter by. - :type resource_group_filter: list[any] - :param resource_filter: array of resources to filter by. - :type resource_filter: list[any] - :param meter_filter: array of meters to filter by. - :type meter_filter: list[any] - :param tag_filter: tags to filter by. - :type tag_filter: any - :param threshold: notification threshold percentage as a decimal which activated this alert. - :type threshold: float - :param operator: operator used to compare currentSpend with amount. Possible values include: - "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". - :type operator: str or ~azure.mgmt.costmanagement.models.AlertOperator - :param amount: budget threshold amount. - :type amount: float - :param unit: unit of currency being used. - :type unit: str - :param current_spend: current spend. - :type current_spend: float - :param contact_emails: list of emails to contact. - :type contact_emails: list[str] - :param contact_groups: list of action groups to broadcast to. - :type contact_groups: list[str] - :param contact_roles: list of contact roles. - :type contact_roles: list[str] - :param overriding_alert: overriding alert. - :type overriding_alert: str - """ - - _attribute_map = { - 'time_grain_type': {'key': 'timeGrainType', 'type': 'str'}, - 'period_start_date': {'key': 'periodStartDate', 'type': 'str'}, - 'triggered_by': {'key': 'triggeredBy', 'type': 'str'}, - 'resource_group_filter': {'key': 'resourceGroupFilter', 'type': '[object]'}, - 'resource_filter': {'key': 'resourceFilter', 'type': '[object]'}, - 'meter_filter': {'key': 'meterFilter', 'type': '[object]'}, - 'tag_filter': {'key': 'tagFilter', 'type': 'object'}, - 'threshold': {'key': 'threshold', 'type': 'float'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'amount': {'key': 'amount', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_spend': {'key': 'currentSpend', 'type': 'float'}, - 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, - 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, - 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, - 'overriding_alert': {'key': 'overridingAlert', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertPropertiesDetails, self).__init__(**kwargs) - self.time_grain_type = kwargs.get('time_grain_type', None) - self.period_start_date = kwargs.get('period_start_date', None) - self.triggered_by = kwargs.get('triggered_by', None) - self.resource_group_filter = kwargs.get('resource_group_filter', None) - self.resource_filter = kwargs.get('resource_filter', None) - self.meter_filter = kwargs.get('meter_filter', None) - self.tag_filter = kwargs.get('tag_filter', None) - self.threshold = kwargs.get('threshold', None) - self.operator = kwargs.get('operator', None) - self.amount = kwargs.get('amount', None) - self.unit = kwargs.get('unit', None) - self.current_spend = kwargs.get('current_spend', None) - self.contact_emails = kwargs.get('contact_emails', None) - self.contact_groups = kwargs.get('contact_groups', None) - self.contact_roles = kwargs.get('contact_roles', None) - self.overriding_alert = kwargs.get('overriding_alert', None) - - -class AlertsResult(msrest.serialization.Model): - """Result of alerts. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of alerts. - :vartype value: list[~azure.mgmt.costmanagement.models.Alert] - :ivar next_link: URL to get the next set of alerts results if there are any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Alert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertsResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class CacheItem(msrest.serialization.Model): - """CacheItem. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. Resource ID used by Resource Manager to uniquely identify the scope. - :type id: str - :param name: Required. Display name for the scope. - :type name: str - :param channel: Required. Indicates the account type. Allowed values include: EA, PAYG, Modern, - Internal, Unknown. - :type channel: str - :param subchannel: Required. Indicates the type of modern account. Allowed values include: - Individual, Enterprise, Partner, Indirect, NotApplicable. - :type subchannel: str - :param parent: Resource ID of the parent scope. For instance, subscription's resource ID for a - resource group or a management group resource ID for a subscription. - :type parent: str - :param status: Indicates the status of the scope. Status only applies to subscriptions and - billing accounts. - :type status: str - """ - - _validation = { - 'id': {'required': True}, - 'name': {'required': True}, - 'channel': {'required': True}, - 'subchannel': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'channel': {'key': 'channel', 'type': 'str'}, - 'subchannel': {'key': 'subchannel', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CacheItem, self).__init__(**kwargs) - self.id = kwargs['id'] - self.name = kwargs['name'] - self.channel = kwargs['channel'] - self.subchannel = kwargs['subchannel'] - self.parent = kwargs.get('parent', None) - self.status = kwargs.get('status', None) - - -class CommonExportProperties(msrest.serialization.Model): - """The common properties of the export. - - All required parameters must be populated in order to send to Azure. - - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition - """ - - _validation = { - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, - } - - def __init__( - self, - **kwargs - ): - super(CommonExportProperties, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs['delivery_info'] - self.definition = kwargs['definition'] - - -class Dimension(Resource): - """Dimension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar description: Dimension description. - :vartype description: str - :ivar filter_enabled: Filter enabled. - :vartype filter_enabled: bool - :ivar grouping_enabled: Grouping enabled. - :vartype grouping_enabled: bool - :param data: - :type data: list[str] - :ivar total: Total number of data for the dimension. - :vartype total: int - :ivar category: Dimension category. - :vartype category: str - :ivar usage_start: Usage start. - :vartype usage_start: ~datetime.datetime - :ivar usage_end: Usage end. - :vartype usage_end: ~datetime.datetime - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'description': {'readonly': True}, - 'filter_enabled': {'readonly': True}, - 'grouping_enabled': {'readonly': True}, - 'total': {'readonly': True}, - 'category': {'readonly': True}, - 'usage_start': {'readonly': True}, - 'usage_end': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, - 'grouping_enabled': {'key': 'properties.groupingEnabled', 'type': 'bool'}, - 'data': {'key': 'properties.data', 'type': '[str]'}, - 'total': {'key': 'properties.total', 'type': 'int'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, - 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, - 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Dimension, self).__init__(**kwargs) - self.description = None - self.filter_enabled = None - self.grouping_enabled = None - self.data = kwargs.get('data', None) - self.total = None - self.category = None - self.usage_start = None - self.usage_end = None - self.next_link = None - - -class DimensionsListResult(msrest.serialization.Model): - """Result of listing dimensions. It contains a list of available dimensions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of dimensions. - :vartype value: list[~azure.mgmt.costmanagement.models.Dimension] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Dimension]'}, - } - - def __init__( - self, - **kwargs - ): - super(DimensionsListResult, self).__init__(**kwargs) - self.value = None - - -class DismissAlertPayload(msrest.serialization.Model): - """The request payload to update an alert. - - :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition - :param description: Alert description. - :type description: str - :param source: Source of alert. Possible values include: "Preset", "User". - :type source: str or ~azure.mgmt.costmanagement.models.AlertSource - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails - :param cost_entity_id: related budget. - :type cost_entity_id: str - :param status: alert status. Possible values include: "None", "Active", "Overridden", - "Resolved", "Dismissed". - :type status: str or ~azure.mgmt.costmanagement.models.AlertStatus - :param creation_time: dateTime in which alert was created. - :type creation_time: str - :param close_time: dateTime in which alert was closed. - :type close_time: str - :param modification_time: dateTime in which alert was last modified. - :type modification_time: str - :param status_modification_user_name: - :type status_modification_user_name: str - :param status_modification_time: dateTime in which the alert status was last modified. - :type status_modification_time: str - """ - - _attribute_map = { - 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - 'details': {'key': 'properties.details', 'type': 'AlertPropertiesDetails'}, - 'cost_entity_id': {'key': 'properties.costEntityId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, - 'close_time': {'key': 'properties.closeTime', 'type': 'str'}, - 'modification_time': {'key': 'properties.modificationTime', 'type': 'str'}, - 'status_modification_user_name': {'key': 'properties.statusModificationUserName', 'type': 'str'}, - 'status_modification_time': {'key': 'properties.statusModificationTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DismissAlertPayload, self).__init__(**kwargs) - self.definition = kwargs.get('definition', None) - self.description = kwargs.get('description', None) - self.source = kwargs.get('source', None) - self.details = kwargs.get('details', None) - self.cost_entity_id = kwargs.get('cost_entity_id', None) - self.status = kwargs.get('status', None) - self.creation_time = kwargs.get('creation_time', None) - self.close_time = kwargs.get('close_time', None) - self.modification_time = kwargs.get('modification_time', None) - self.status_modification_user_name = kwargs.get('status_modification_user_name', None) - self.status_modification_time = kwargs.get('status_modification_time', None) - - -class ErrorDetails(msrest.serialization.Model): - """The details of the error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code. - :vartype code: str - :ivar message: Error message indicating why the operation failed. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.message = None - - -class ErrorResponse(msrest.serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. - -Some Error responses: - - -* - 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. - -* - 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. - - :param error: The details of the error. - :type error: ~azure.mgmt.costmanagement.models.ErrorDetails - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ProxyResource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = kwargs.get('e_tag', None) - - -class Export(ProxyResource): - """A export resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, - } - - def __init__( - self, - **kwargs - ): - super(Export, self).__init__(**kwargs) - self.format = kwargs.get('format', None) - self.delivery_info = kwargs.get('delivery_info', None) - self.definition = kwargs.get('definition', None) - self.schedule = kwargs.get('schedule', None) - - -class ExportDefinition(msrest.serialization.Model): - """The definition of a query. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a - specific time period must be provided. Possible values include: "MonthToDate", - "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param data_set: Has definition for data in this query. - :type data_set: ~azure.mgmt.costmanagement.models.QueryDatasetAutoGenerated - """ - - _validation = { - 'type': {'required': True}, - 'timeframe': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'data_set': {'key': 'dataSet', 'type': 'QueryDatasetAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportDefinition, self).__init__(**kwargs) - self.type = kwargs['type'] - self.timeframe = kwargs['timeframe'] - self.time_period = kwargs.get('time_period', None) - self.data_set = kwargs.get('data_set', None) - - -class ExportDeliveryDestination(msrest.serialization.Model): - """The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services . - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The resource id of the storage account where exports will be - delivered. - :type resource_id: str - :param container: Required. The name of the container where exports will be uploaded. - :type container: str - :param root_folder_path: The name of the directory where exports will be uploaded. - :type root_folder_path: str - """ - - _validation = { - 'resource_id': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'container': {'key': 'container', 'type': 'str'}, - 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportDeliveryDestination, self).__init__(**kwargs) - self.resource_id = kwargs['resource_id'] - self.container = kwargs['container'] - self.root_folder_path = kwargs.get('root_folder_path', None) - - -class ExportDeliveryInfo(msrest.serialization.Model): - """The delivery information associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination - """ - - _validation = { - 'destination': {'required': True}, - } - - _attribute_map = { - 'destination': {'key': 'destination', 'type': 'ExportDeliveryDestination'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportDeliveryInfo, self).__init__(**kwargs) - self.destination = kwargs['destination'] - - -class ExportExecution(Resource): - """A export execution. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param execution_type: The type of the export execution. Possible values include: "OnDemand", - "Scheduled". - :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", - "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus - :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. - :type submitted_by: str - :param submitted_time: The time when export was queued to be executed. - :type submitted_time: ~datetime.datetime - :param processing_start_time: The time when export was picked up to be executed. - :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. - :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. - :type file_name: str - :param run_settings: The common properties of the export. - :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, - 'submitted_time': {'key': 'properties.submittedTime', 'type': 'iso-8601'}, - 'processing_start_time': {'key': 'properties.processingStartTime', 'type': 'iso-8601'}, - 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, - 'file_name': {'key': 'properties.fileName', 'type': 'str'}, - 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportExecution, self).__init__(**kwargs) - self.execution_type = kwargs.get('execution_type', None) - self.status = kwargs.get('status', None) - self.submitted_by = kwargs.get('submitted_by', None) - self.submitted_time = kwargs.get('submitted_time', None) - self.processing_start_time = kwargs.get('processing_start_time', None) - self.processing_end_time = kwargs.get('processing_end_time', None) - self.file_name = kwargs.get('file_name', None) - self.run_settings = kwargs.get('run_settings', None) - - -class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of export executions. - :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExportExecution]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportExecutionListResult, self).__init__(**kwargs) - self.value = None - - -class ExportListResult(msrest.serialization.Model): - """Result of listing exports. It contains a list of available exports in the scope provided. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of exports. - :vartype value: list[~azure.mgmt.costmanagement.models.Export] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Export]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportListResult, self).__init__(**kwargs) - self.value = None - - -class ExportProperties(CommonExportProperties): - """The properties of the export. - - All required parameters must be populated in order to send to Azure. - - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule - """ - - _validation = { - 'delivery_info': {'required': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, - 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportProperties, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - - -class ExportRecurrencePeriod(msrest.serialization.Model): - """The start and end date for recurrence schedule. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date of recurrence. - :type from_property: ~datetime.datetime - :param to: The end date of recurrence. - :type to: ~datetime.datetime - """ - - _validation = { - 'from_property': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportRecurrencePeriod, self).__init__(**kwargs) - self.from_property = kwargs['from_property'] - self.to = kwargs.get('to', None) - - -class ExportSchedule(msrest.serialization.Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values include: "Daily", - "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Has start and end date of the recurrence. The start date must be in - future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod - """ - - _validation = { - 'recurrence': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'recurrence': {'key': 'recurrence', 'type': 'str'}, - 'recurrence_period': {'key': 'recurrencePeriod', 'type': 'ExportRecurrencePeriod'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportSchedule, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.recurrence = kwargs['recurrence'] - self.recurrence_period = kwargs.get('recurrence_period', None) - - -class ForecastDefinition(msrest.serialization.Model): - """The definition of a forecast. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. The type of the forecast. Possible values include: "Usage", - "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType - :param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a - specific time period must be provided. Possible values include: "MonthToDate", - "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType - :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Required. Has definition for data in this forecast. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset - :param include_actual_cost: a boolean determining if actualCost will be included. - :type include_actual_cost: bool - :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. - :type include_fresh_partial_cost: bool - """ - - _validation = { - 'type': {'required': True}, - 'timeframe': {'required': True}, - 'dataset': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, - 'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'}, - 'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ForecastDefinition, self).__init__(**kwargs) - self.type = kwargs['type'] - self.timeframe = kwargs['timeframe'] - self.time_period = kwargs.get('time_period', None) - self.dataset = kwargs['dataset'] - self.include_actual_cost = kwargs.get('include_actual_cost', None) - self.include_fresh_partial_cost = kwargs.get('include_fresh_partial_cost', None) - - -class KpiProperties(msrest.serialization.Model): - """Each KPI must contain a 'type' and 'enabled' key. - - :param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". - :type type: str or ~azure.mgmt.costmanagement.models.KpiType - :param id: ID of resource related to metric (budget). - :type id: str - :param enabled: show the KPI in the UI?. - :type enabled: bool - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(KpiProperties, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.id = kwargs.get('id', None) - self.enabled = kwargs.get('enabled', None) - - -class Operation(msrest.serialization.Model): - """A Cost management REST API operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = kwargs.get('display', None) - - -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Service provider: Microsoft.CostManagement. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Dimensions, Query. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - - -class OperationListResult(msrest.serialization.Model): - """Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of cost management operations supported by the Microsoft.CostManagement - resource provider. - :vartype value: list[~azure.mgmt.costmanagement.models.Operation] - :ivar next_link: URL to get the next set of operation list results if there are any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OperationStatus(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. - :type status: ~azure.mgmt.costmanagement.models.Status - :param report_url: The URL to download the generated report. - :type report_url: str - :param valid_until: The time at which report URL becomes invalid. - :type valid_until: ~datetime.datetime - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'Status'}, - 'report_url': {'key': 'properties.reportUrl', 'type': 'str'}, - 'valid_until': {'key': 'properties.validUntil', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatus, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.report_url = kwargs.get('report_url', None) - self.valid_until = kwargs.get('valid_until', None) - - -class PivotProperties(msrest.serialization.Model): - """Each pivot must contain a 'type' and 'name'. - - :param type: Data type to show in view. Possible values include: "Dimension", "TagKey". - :type type: str or ~azure.mgmt.costmanagement.models.PivotType - :param name: Data field to show in view. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PivotProperties, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class ProxySettingResource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxySettingResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.kind = None - self.type = None - - -class QueryAggregation(msrest.serialization.Model): - """The aggregation expression to be used in the query. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to aggregate. - :type name: str - :param function: Required. The name of the aggregation function to use. Possible values - include: "Avg", "Max", "Min", "Sum". - :type function: str or ~azure.mgmt.costmanagement.models.FunctionType - """ - - _validation = { - 'name': {'required': True}, - 'function': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'function': {'key': 'function', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryAggregation, self).__init__(**kwargs) - self.name = kwargs['name'] - self.function = kwargs['function'] - - -class QueryColumn(msrest.serialization.Model): - """QueryColumn. - - :param name: The name of column. - :type name: str - :param type: The type of column. - :type type: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryColumn, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class QueryComparisonExpression(msrest.serialization.Model): - """The comparison expression to be used in the query. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to use in comparison. - :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", - "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType - :param values: Required. Array of values to use for comparison. - :type values: list[str] - """ - - _validation = { - 'name': {'required': True}, - 'operator': {'required': True}, - 'values': {'required': True, 'min_items': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryComparisonExpression, self).__init__(**kwargs) - self.name = kwargs['name'] - self.operator = kwargs['operator'] - self.values = kwargs['values'] - - -class QueryDataset(msrest.serialization.Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: The filter expression to use in the query. Please reference our Query API REST - documentation for how to properly format the filter. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilter'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryDataset, self).__init__(**kwargs) - self.granularity = kwargs.get('granularity', None) - self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.filter = kwargs.get('filter', None) - - -class QueryDatasetAutoGenerated(msrest.serialization.Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: The filter expression to use in the query. Please reference our Query API REST - documentation for how to properly format the filter. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilterAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryDatasetAutoGenerated, self).__init__(**kwargs) - self.granularity = kwargs.get('granularity', None) - self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.filter = kwargs.get('filter', None) - - -class QueryDatasetConfiguration(msrest.serialization.Model): - """The configuration of dataset in the query. - - :param columns: Array of column names to be included in the query. Any valid query column name - is allowed. If not provided, then query includes all columns. - :type columns: list[str] - """ - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryDatasetConfiguration, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - - -class QueryDefinition(msrest.serialization.Model): - """The definition of a query. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a - specific time period must be provided. Possible values include: "MonthToDate", - "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Required. Has definition for data in this query. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset - """ - - _validation = { - 'type': {'required': True}, - 'timeframe': {'required': True}, - 'dataset': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryDefinition, self).__init__(**kwargs) - self.type = kwargs['type'] - self.timeframe = kwargs['timeframe'] - self.time_period = kwargs.get('time_period', None) - self.dataset = kwargs['dataset'] - - -class QueryFilter(msrest.serialization.Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilter]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryFilter, self).__init__(**kwargs) - self.and_property = kwargs.get('and_property', None) - self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) - - -class QueryFilterAutoGenerated(msrest.serialization.Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilterAutoGenerated]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilterAutoGenerated]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryFilterAutoGenerated, self).__init__(**kwargs) - self.and_property = kwargs.get('and_property', None) - self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) - - -class QueryGrouping(msrest.serialization.Model): - """The group by expression to be used in the query. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Has type of the column to group. Possible values include: "Tag", - "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType - :param name: Required. The name of the column to group. - :type name: str - """ - - _validation = { - 'type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryGrouping, self).__init__(**kwargs) - self.type = kwargs['type'] - self.name = kwargs['name'] - - -class QueryResult(Resource): - """Result of query. It contains all columns listed under groupings and aggregation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :ivar location: Resource location. - :vartype location: str - :ivar sku: Resource SKU. - :vartype sku: str - :param next_link: The link (url) to the next page of results. - :type next_link: str - :param columns: Array of columns. - :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] - :param rows: Array of rows. - :type rows: list[list[any]] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'readonly': True}, - 'location': {'readonly': True}, - 'sku': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, - 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, - 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, - 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryResult, self).__init__(**kwargs) - self.e_tag = kwargs.get('e_tag', None) - self.location = None - self.sku = None - self.next_link = kwargs.get('next_link', None) - self.columns = kwargs.get('columns', None) - self.rows = kwargs.get('rows', None) - - -class QueryTimePeriod(msrest.serialization.Model): - """The start and end date for pulling data for the query. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date to pull data from. - :type from_property: ~datetime.datetime - :param to: Required. The end date to pull data to. - :type to: ~datetime.datetime - """ - - _validation = { - 'from_property': {'required': True}, - 'to': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryTimePeriod, self).__init__(**kwargs) - self.from_property = kwargs['from_property'] - self.to = kwargs['to'] - - -class ReportConfigAggregation(msrest.serialization.Model): - """The aggregation expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to aggregate. - :type name: str - :param function: Required. The name of the aggregation function to use. Possible values - include: "Avg", "Max", "Min", "Sum". - :type function: str or ~azure.mgmt.costmanagement.models.FunctionType - """ - - _validation = { - 'name': {'required': True}, - 'function': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'function': {'key': 'function', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigAggregation, self).__init__(**kwargs) - self.name = kwargs['name'] - self.function = kwargs['function'] - - -class ReportConfigComparisonExpression(msrest.serialization.Model): - """The comparison expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the column to use in comparison. - :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", - "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType - :param values: Required. Array of values to use for comparison. - :type values: list[str] - """ - - _validation = { - 'name': {'required': True}, - 'operator': {'required': True}, - 'values': {'required': True, 'min_items': 1}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigComparisonExpression, self).__init__(**kwargs) - self.name = kwargs['name'] - self.operator = kwargs['operator'] - self.values = kwargs['values'] - - -class ReportConfigDataset(msrest.serialization.Model): - """The definition of data present in the report. - - :param granularity: The granularity of rows in the report. Possible values include: "Daily", - "Monthly". - :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType - :param configuration: Has configuration information for the data in the report. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the report. The key of each - item in the dictionary is the alias for the aggregated column. Report can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report can have up to 2 - group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'ReportConfigDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{ReportConfigAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[ReportConfigGrouping]'}, - 'sorting': {'key': 'sorting', 'type': '[ReportConfigSorting]'}, - 'filter': {'key': 'filter', 'type': 'ReportConfigFilter'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigDataset, self).__init__(**kwargs) - self.granularity = kwargs.get('granularity', None) - self.configuration = kwargs.get('configuration', None) - self.aggregation = kwargs.get('aggregation', None) - self.grouping = kwargs.get('grouping', None) - self.sorting = kwargs.get('sorting', None) - self.filter = kwargs.get('filter', None) - - -class ReportConfigDatasetConfiguration(msrest.serialization.Model): - """The configuration of dataset in the report. - - :param columns: Array of column names to be included in the report. Any valid report column - name is allowed. If not provided, then report includes all columns. - :type columns: list[str] - """ - - _attribute_map = { - 'columns': {'key': 'columns', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) - self.columns = kwargs.get('columns', None) - - -class ReportConfigFilter(msrest.serialization.Model): - """The filter expression to be used in the report. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_key: Has comparison expression for a tag key. - :type tag_key: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_value: Has comparison expression for a tag value. - :type tag_value: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[ReportConfigFilter]'}, - 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, - 'dimensions': {'key': 'dimensions', 'type': 'ReportConfigComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'ReportConfigComparisonExpression'}, - 'tag_key': {'key': 'tagKey', 'type': 'ReportConfigComparisonExpression'}, - 'tag_value': {'key': 'tagValue', 'type': 'ReportConfigComparisonExpression'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigFilter, self).__init__(**kwargs) - self.and_property = kwargs.get('and_property', None) - self.or_property = kwargs.get('or_property', None) - self.dimensions = kwargs.get('dimensions', None) - self.tags = kwargs.get('tags', None) - self.tag_key = kwargs.get('tag_key', None) - self.tag_value = kwargs.get('tag_value', None) - - -class ReportConfigGrouping(msrest.serialization.Model): - """The group by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Has type of the column to group. Possible values include: "Tag", - "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version supports subscription - lowest possible grain. - :type name: str - """ - - _validation = { - 'type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigGrouping, self).__init__(**kwargs) - self.type = kwargs['type'] - self.name = kwargs['name'] - - -class ReportConfigSorting(msrest.serialization.Model): - """The order by expression to be used in the report. - - All required parameters must be populated in order to send to Azure. - - :param direction: Direction of sort. Possible values include: "Ascending", "Descending". - :type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection - :param name: Required. The name of the column to sort. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'direction': {'key': 'direction', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigSorting, self).__init__(**kwargs) - self.direction = kwargs.get('direction', None) - self.name = kwargs['name'] - - -class ReportConfigTimePeriod(msrest.serialization.Model): - """The start and end date for pulling data for the report. - - All required parameters must be populated in order to send to Azure. - - :param from_property: Required. The start date to pull data from. - :type from_property: ~datetime.datetime - :param to: Required. The end date to pull data to. - :type to: ~datetime.datetime - """ - - _validation = { - 'from_property': {'required': True}, - 'to': {'required': True}, - } - - _attribute_map = { - 'from_property': {'key': 'from', 'type': 'iso-8601'}, - 'to': {'key': 'to', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ReportConfigTimePeriod, self).__init__(**kwargs) - self.from_property = kwargs['from_property'] - self.to = kwargs['to'] - - -class Setting(ProxySettingResource): - """State of the myscope setting. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - :param scope: Sets the default scope the current user will see when they sign into Azure Cost - Management in the Azure portal. - :type scope: str - :param start_on: Indicates what scope Cost Management in the Azure portal should default to. - Allowed values: LastUsed. Possible values include: "LastUsed", "ScopePicker", "SpecificScope". - :type start_on: str or ~azure.mgmt.costmanagement.models.SettingsPropertiesStartOn - :param cache: Array of scopes with additional details used by Cost Management in the Azure - portal. - :type cache: list[~azure.mgmt.costmanagement.models.CacheItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'start_on': {'key': 'properties.startOn', 'type': 'str'}, - 'cache': {'key': 'properties.cache', 'type': '[CacheItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.scope = kwargs.get('scope', None) - self.start_on = kwargs.get('start_on', None) - self.cache = kwargs.get('cache', None) - - -class SettingsListResult(msrest.serialization.Model): - """Result of listing settings. It contains a list of available settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of settings. - :vartype value: list[~azure.mgmt.costmanagement.models.Setting] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True, 'max_items': 10, 'min_items': 0}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Setting]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SettingsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class Status(msrest.serialization.Model): - """The status of the long running operation. - - :param status: The status of the long running operation. Possible values include: "Running", - "Completed", "Failed". - :type status: str or ~azure.mgmt.costmanagement.models.OperationStatusType - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Status, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - - -class View(ProxyResource): - """States and configurations of Cost Analysis. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :param display_name: User input name of the view. Required. - :type display_name: str - :param scope: Cost Management scope to save the view on. This includes - 'subscriptions/{subscriptionId}' for subscription scope, - 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for - Department scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - for EnrollmentAccount scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - for BillingProfile scope, - 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' - for Management Group scope, - '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for - ExternalBillingAccount scope, and - '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for - ExternalSubscription scope. - :type scope: str - :ivar created_on: Date the user created this view. - :vartype created_on: ~datetime.datetime - :ivar modified_on: Date when the user last modified this view. - :vartype modified_on: ~datetime.datetime - :ivar date_range: Selected date range for viewing cost in. - :vartype date_range: str - :ivar currency: Selected currency. - :vartype currency: str - :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: - "Area", "Line", "StackedColumn", "GroupedColumn", "Table". - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType - :param accumulated: Show costs accumulated over time. Possible values include: "true", "false". - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType - :param metric: Metric to use when displaying costs. Possible values include: "ActualCost", - "AmortizedCost", "AHUB". - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType - :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] - :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] - :param type_properties_query_type: The type of the report. Usage represents actual usage, - forecast represents forecasted data and UsageAndForecast represents both usage and forecasted - data. Actual usage and forecasted data can be differentiated based on dates. Possible values - include: "Usage". - :type type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType - :param timeframe: The time frame for pulling data for the report. If custom, then a specific - time period must be provided. Possible values include: "WeekToDate", "MonthToDate", - "YearToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param data_set: Has definition for data in this report config. - :type data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset - :ivar include_monetary_commitment: Include monetary commitment. - :vartype include_monetary_commitment: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_on': {'readonly': True}, - 'modified_on': {'readonly': True}, - 'date_range': {'readonly': True}, - 'currency': {'readonly': True}, - 'include_monetary_commitment': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, - 'modified_on': {'key': 'properties.modifiedOn', 'type': 'iso-8601'}, - 'date_range': {'key': 'properties.dateRange', 'type': 'str'}, - 'currency': {'key': 'properties.currency', 'type': 'str'}, - 'chart': {'key': 'properties.chart', 'type': 'str'}, - 'accumulated': {'key': 'properties.accumulated', 'type': 'str'}, - 'metric': {'key': 'properties.metric', 'type': 'str'}, - 'kpis': {'key': 'properties.kpis', 'type': '[KpiProperties]'}, - 'pivots': {'key': 'properties.pivots', 'type': '[PivotProperties]'}, - 'type_properties_query_type': {'key': 'properties.query.type', 'type': 'str'}, - 'timeframe': {'key': 'properties.query.timeframe', 'type': 'str'}, - 'time_period': {'key': 'properties.query.timePeriod', 'type': 'ReportConfigTimePeriod'}, - 'data_set': {'key': 'properties.query.dataSet', 'type': 'ReportConfigDataset'}, - 'include_monetary_commitment': {'key': 'properties.query.includeMonetaryCommitment', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(View, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.scope = kwargs.get('scope', None) - self.created_on = None - self.modified_on = None - self.date_range = None - self.currency = None - self.chart = kwargs.get('chart', None) - self.accumulated = kwargs.get('accumulated', None) - self.metric = kwargs.get('metric', None) - self.kpis = kwargs.get('kpis', None) - self.pivots = kwargs.get('pivots', None) - self.type_properties_query_type = kwargs.get('type_properties_query_type', None) - self.timeframe = kwargs.get('timeframe', None) - self.time_period = kwargs.get('time_period', None) - self.data_set = kwargs.get('data_set', None) - self.include_monetary_commitment = None - - -class ViewListResult(msrest.serialization.Model): - """Result of listing views. It contains a list of available views. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of views. - :vartype value: list[~azure.mgmt.costmanagement.models.View] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[View]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ViewListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py index e3f7e70197dd..f52ce39327df 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/models/_models_py3.py @@ -15,7 +15,7 @@ from ._cost_management_client_enums import * -class Resource(msrest.serialization.Model): +class ProxyResource(msrest.serialization.Model): """The Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -26,36 +26,43 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :ivar e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :vartype e_tag: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, } def __init__( self, + *, + e_tag: Optional[str] = None, **kwargs ): - super(Resource, self).__init__(**kwargs) + """ + :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :paramtype e_tag: str + """ + super(ProxyResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.tags = None + self.e_tag = e_tag -class Alert(Resource): +class Alert(ProxyResource): """An individual alert. Variables are only populated by the server, and will be ignored when sending a request. @@ -66,45 +73,45 @@ class Alert(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition - :param description: Alert description. - :type description: str - :param source: Source of alert. Possible values include: "Preset", "User". - :type source: str or ~azure.mgmt.costmanagement.models.AlertSource - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails - :param cost_entity_id: related budget. - :type cost_entity_id: str - :param status: alert status. Possible values include: "None", "Active", "Overridden", + :ivar e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :vartype e_tag: str + :ivar definition: defines the type of alert. + :vartype definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :ivar description: Alert description. + :vartype description: str + :ivar source: Source of alert. Possible values include: "Preset", "User". + :vartype source: str or ~azure.mgmt.costmanagement.models.AlertSource + :ivar details: Alert details. + :vartype details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :ivar cost_entity_id: related budget. + :vartype cost_entity_id: str + :ivar status: alert status. Possible values include: "None", "Active", "Overridden", "Resolved", "Dismissed". - :type status: str or ~azure.mgmt.costmanagement.models.AlertStatus - :param creation_time: dateTime in which alert was created. - :type creation_time: str - :param close_time: dateTime in which alert was closed. - :type close_time: str - :param modification_time: dateTime in which alert was last modified. - :type modification_time: str - :param status_modification_user_name: - :type status_modification_user_name: str - :param status_modification_time: dateTime in which the alert status was last modified. - :type status_modification_time: str + :vartype status: str or ~azure.mgmt.costmanagement.models.AlertStatus + :ivar creation_time: dateTime in which alert was created. + :vartype creation_time: str + :ivar close_time: dateTime in which alert was closed. + :vartype close_time: str + :ivar modification_time: dateTime in which alert was last modified. + :vartype modification_time: str + :ivar status_modification_user_name: User who last modified the alert. + :vartype status_modification_user_name: str + :ivar status_modification_time: dateTime in which the alert status was last modified. + :vartype status_modification_time: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, 'definition': {'key': 'properties.definition', 'type': 'AlertPropertiesDefinition'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'source': {'key': 'properties.source', 'type': 'str'}, @@ -121,6 +128,7 @@ class Alert(Resource): def __init__( self, *, + e_tag: Optional[str] = None, definition: Optional["AlertPropertiesDefinition"] = None, description: Optional[str] = None, source: Optional[Union[str, "AlertSource"]] = None, @@ -134,7 +142,35 @@ def __init__( status_modification_time: Optional[str] = None, **kwargs ): - super(Alert, self).__init__(**kwargs) + """ + :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :paramtype e_tag: str + :keyword definition: defines the type of alert. + :paramtype definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :keyword description: Alert description. + :paramtype description: str + :keyword source: Source of alert. Possible values include: "Preset", "User". + :paramtype source: str or ~azure.mgmt.costmanagement.models.AlertSource + :keyword details: Alert details. + :paramtype details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :keyword cost_entity_id: related budget. + :paramtype cost_entity_id: str + :keyword status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :paramtype status: str or ~azure.mgmt.costmanagement.models.AlertStatus + :keyword creation_time: dateTime in which alert was created. + :paramtype creation_time: str + :keyword close_time: dateTime in which alert was closed. + :paramtype close_time: str + :keyword modification_time: dateTime in which alert was last modified. + :paramtype modification_time: str + :keyword status_modification_user_name: User who last modified the alert. + :paramtype status_modification_user_name: str + :keyword status_modification_time: dateTime in which the alert status was last modified. + :paramtype status_modification_time: str + """ + super(Alert, self).__init__(e_tag=e_tag, **kwargs) self.definition = definition self.description = description self.source = source @@ -151,18 +187,18 @@ def __init__( class AlertPropertiesDefinition(msrest.serialization.Model): """defines the type of alert. - :param type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", + :ivar type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", "General", "xCloud", "BudgetForecast". - :type type: str or ~azure.mgmt.costmanagement.models.AlertType - :param category: Alert category. Possible values include: "Cost", "Usage", "Billing", "System". - :type category: str or ~azure.mgmt.costmanagement.models.AlertCategory - :param criteria: Criteria that triggered alert. Possible values include: + :vartype type: str or ~azure.mgmt.costmanagement.models.AlertType + :ivar category: Alert category. Possible values include: "Cost", "Usage", "Billing", "System". + :vartype category: str or ~azure.mgmt.costmanagement.models.AlertCategory + :ivar criteria: Criteria that triggered alert. Possible values include: "CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", "CrossCloudCollectionError", "GeneralThresholdError". - :type criteria: str or ~azure.mgmt.costmanagement.models.AlertCriteria + :vartype criteria: str or ~azure.mgmt.costmanagement.models.AlertCriteria """ _attribute_map = { @@ -179,6 +215,21 @@ def __init__( criteria: Optional[Union[str, "AlertCriteria"]] = None, **kwargs ): + """ + :keyword type: type of alert. Possible values include: "Budget", "Invoice", "Credit", "Quota", + "General", "xCloud", "BudgetForecast". + :paramtype type: str or ~azure.mgmt.costmanagement.models.AlertType + :keyword category: Alert category. Possible values include: "Cost", "Usage", "Billing", + "System". + :paramtype category: str or ~azure.mgmt.costmanagement.models.AlertCategory + :keyword criteria: Criteria that triggered alert. Possible values include: + "CostThresholdExceeded", "UsageThresholdExceeded", "CreditThresholdApproaching", + "CreditThresholdReached", "QuotaThresholdApproaching", "QuotaThresholdReached", + "MultiCurrency", "ForecastCostThresholdExceeded", "ForecastUsageThresholdExceeded", + "InvoiceDueDateApproaching", "InvoiceDueDateReached", "CrossCloudNewDataAvailable", + "CrossCloudCollectionError", "GeneralThresholdError". + :paramtype criteria: str or ~azure.mgmt.costmanagement.models.AlertCriteria + """ super(AlertPropertiesDefinition, self).__init__(**kwargs) self.type = type self.category = category @@ -188,40 +239,52 @@ def __init__( class AlertPropertiesDetails(msrest.serialization.Model): """Alert details. - :param time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", + :ivar time_grain_type: Type of timegrain cadence. Possible values include: "None", "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". - :type time_grain_type: str or ~azure.mgmt.costmanagement.models.AlertTimeGrainType - :param period_start_date: datetime of periodStartDate. - :type period_start_date: str - :param triggered_by: notificationId that triggered this alert. - :type triggered_by: str - :param resource_group_filter: array of resourceGroups to filter by. - :type resource_group_filter: list[any] - :param resource_filter: array of resources to filter by. - :type resource_filter: list[any] - :param meter_filter: array of meters to filter by. - :type meter_filter: list[any] - :param tag_filter: tags to filter by. - :type tag_filter: any - :param threshold: notification threshold percentage as a decimal which activated this alert. - :type threshold: float - :param operator: operator used to compare currentSpend with amount. Possible values include: + :vartype time_grain_type: str or ~azure.mgmt.costmanagement.models.AlertTimeGrainType + :ivar period_start_date: datetime of periodStartDate. + :vartype period_start_date: str + :ivar triggered_by: notificationId that triggered this alert. + :vartype triggered_by: str + :ivar resource_group_filter: array of resourceGroups to filter by. + :vartype resource_group_filter: list[any] + :ivar resource_filter: array of resources to filter by. + :vartype resource_filter: list[any] + :ivar meter_filter: array of meters to filter by. + :vartype meter_filter: list[any] + :ivar tag_filter: tags to filter by. + :vartype tag_filter: any + :ivar threshold: notification threshold percentage as a decimal which activated this alert. + :vartype threshold: float + :ivar operator: operator used to compare currentSpend with amount. Possible values include: "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". - :type operator: str or ~azure.mgmt.costmanagement.models.AlertOperator - :param amount: budget threshold amount. - :type amount: float - :param unit: unit of currency being used. - :type unit: str - :param current_spend: current spend. - :type current_spend: float - :param contact_emails: list of emails to contact. - :type contact_emails: list[str] - :param contact_groups: list of action groups to broadcast to. - :type contact_groups: list[str] - :param contact_roles: list of contact roles. - :type contact_roles: list[str] - :param overriding_alert: overriding alert. - :type overriding_alert: str + :vartype operator: str or ~azure.mgmt.costmanagement.models.AlertOperator + :ivar amount: budget threshold amount. + :vartype amount: float + :ivar unit: unit of currency being used. + :vartype unit: str + :ivar current_spend: current spend. + :vartype current_spend: float + :ivar contact_emails: list of emails to contact. + :vartype contact_emails: list[str] + :ivar contact_groups: list of action groups to broadcast to. + :vartype contact_groups: list[str] + :ivar contact_roles: list of contact roles. + :vartype contact_roles: list[str] + :ivar overriding_alert: overriding alert. + :vartype overriding_alert: str + :ivar department_name: department name. + :vartype department_name: str + :ivar company_name: company name. + :vartype company_name: str + :ivar enrollment_number: enrollment number. + :vartype enrollment_number: str + :ivar enrollment_start_date: datetime of enrollmentStartDate. + :vartype enrollment_start_date: str + :ivar enrollment_end_date: datetime of enrollmentEndDate. + :vartype enrollment_end_date: str + :ivar invoicing_threshold: invoicing threshold. + :vartype invoicing_threshold: float """ _attribute_map = { @@ -241,6 +304,12 @@ class AlertPropertiesDetails(msrest.serialization.Model): 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, 'overriding_alert': {'key': 'overridingAlert', 'type': 'str'}, + 'department_name': {'key': 'departmentName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'enrollment_number': {'key': 'enrollmentNumber', 'type': 'str'}, + 'enrollment_start_date': {'key': 'enrollmentStartDate', 'type': 'str'}, + 'enrollment_end_date': {'key': 'enrollmentEndDate', 'type': 'str'}, + 'invoicing_threshold': {'key': 'invoicingThreshold', 'type': 'float'}, } def __init__( @@ -262,8 +331,62 @@ def __init__( contact_groups: Optional[List[str]] = None, contact_roles: Optional[List[str]] = None, overriding_alert: Optional[str] = None, + department_name: Optional[str] = None, + company_name: Optional[str] = None, + enrollment_number: Optional[str] = None, + enrollment_start_date: Optional[str] = None, + enrollment_end_date: Optional[str] = None, + invoicing_threshold: Optional[float] = None, **kwargs ): + """ + :keyword time_grain_type: Type of timegrain cadence. Possible values include: "None", + "Monthly", "Quarterly", "Annually", "BillingMonth", "BillingQuarter", "BillingAnnual". + :paramtype time_grain_type: str or ~azure.mgmt.costmanagement.models.AlertTimeGrainType + :keyword period_start_date: datetime of periodStartDate. + :paramtype period_start_date: str + :keyword triggered_by: notificationId that triggered this alert. + :paramtype triggered_by: str + :keyword resource_group_filter: array of resourceGroups to filter by. + :paramtype resource_group_filter: list[any] + :keyword resource_filter: array of resources to filter by. + :paramtype resource_filter: list[any] + :keyword meter_filter: array of meters to filter by. + :paramtype meter_filter: list[any] + :keyword tag_filter: tags to filter by. + :paramtype tag_filter: any + :keyword threshold: notification threshold percentage as a decimal which activated this alert. + :paramtype threshold: float + :keyword operator: operator used to compare currentSpend with amount. Possible values include: + "None", "EqualTo", "GreaterThan", "GreaterThanOrEqualTo", "LessThan", "LessThanOrEqualTo". + :paramtype operator: str or ~azure.mgmt.costmanagement.models.AlertOperator + :keyword amount: budget threshold amount. + :paramtype amount: float + :keyword unit: unit of currency being used. + :paramtype unit: str + :keyword current_spend: current spend. + :paramtype current_spend: float + :keyword contact_emails: list of emails to contact. + :paramtype contact_emails: list[str] + :keyword contact_groups: list of action groups to broadcast to. + :paramtype contact_groups: list[str] + :keyword contact_roles: list of contact roles. + :paramtype contact_roles: list[str] + :keyword overriding_alert: overriding alert. + :paramtype overriding_alert: str + :keyword department_name: department name. + :paramtype department_name: str + :keyword company_name: company name. + :paramtype company_name: str + :keyword enrollment_number: enrollment number. + :paramtype enrollment_number: str + :keyword enrollment_start_date: datetime of enrollmentStartDate. + :paramtype enrollment_start_date: str + :keyword enrollment_end_date: datetime of enrollmentEndDate. + :paramtype enrollment_end_date: str + :keyword invoicing_threshold: invoicing threshold. + :paramtype invoicing_threshold: float + """ super(AlertPropertiesDetails, self).__init__(**kwargs) self.time_grain_type = time_grain_type self.period_start_date = period_start_date @@ -281,6 +404,12 @@ def __init__( self.contact_groups = contact_groups self.contact_roles = contact_roles self.overriding_alert = overriding_alert + self.department_name = department_name + self.company_name = company_name + self.enrollment_number = enrollment_number + self.enrollment_start_date = enrollment_start_date + self.enrollment_end_date = enrollment_end_date + self.invoicing_threshold = invoicing_threshold class AlertsResult(msrest.serialization.Model): @@ -308,110 +437,146 @@ def __init__( self, **kwargs ): + """ + """ super(AlertsResult, self).__init__(**kwargs) self.value = None self.next_link = None -class CacheItem(msrest.serialization.Model): - """CacheItem. +class CommonExportProperties(msrest.serialization.Model): + """The common properties of the export. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param id: Required. Resource ID used by Resource Manager to uniquely identify the scope. - :type id: str - :param name: Required. Display name for the scope. - :type name: str - :param channel: Required. Indicates the account type. Allowed values include: EA, PAYG, Modern, - Internal, Unknown. - :type channel: str - :param subchannel: Required. Indicates the type of modern account. Allowed values include: - Individual, Enterprise, Partner, Indirect, NotApplicable. - :type subchannel: str - :param parent: Resource ID of the parent scope. For instance, subscription's resource ID for a - resource group or a management group resource ID for a subscription. - :type parent: str - :param status: Indicates the status of the scope. Status only applies to subscriptions and - billing accounts. - :type status: str + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :vartype format: str or ~azure.mgmt.costmanagement.models.FormatType + :ivar delivery_info: Required. Has delivery information for the export. + :vartype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :ivar definition: Required. Has the definition for the export. + :vartype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :ivar run_history: If requested, has the most recent execution history for the export. + :vartype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar partition_data: If set to true, exported data will be partitioned by size and placed in a + blob directory together with a manifest file. Note: this option is currently available only for + modern commerce scopes. + :vartype partition_data: bool + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime """ _validation = { - 'id': {'required': True}, - 'name': {'required': True}, - 'channel': {'required': True}, - 'subchannel': {'required': True}, + 'delivery_info': {'required': True}, + 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'channel': {'key': 'channel', 'type': 'str'}, - 'subchannel': {'key': 'subchannel', 'type': 'str'}, - 'parent': {'key': 'parent', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + 'format': {'key': 'format', 'type': 'str'}, + 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'partition_data': {'key': 'partitionData', 'type': 'bool'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, } def __init__( self, *, - id: str, - name: str, - channel: str, - subchannel: str, - parent: Optional[str] = None, - status: Optional[str] = None, + delivery_info: "ExportDeliveryInfo", + definition: "ExportDefinition", + format: Optional[Union[str, "FormatType"]] = None, + run_history: Optional["ExportExecutionListResult"] = None, + partition_data: Optional[bool] = None, **kwargs ): - super(CacheItem, self).__init__(**kwargs) - self.id = id - self.name = name - self.channel = channel - self.subchannel = subchannel - self.parent = parent - self.status = status + """ + :keyword format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType + :keyword delivery_info: Required. Has delivery information for the export. + :paramtype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :keyword definition: Required. Has the definition for the export. + :paramtype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :keyword run_history: If requested, has the most recent execution history for the export. + :paramtype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :keyword partition_data: If set to true, exported data will be partitioned by size and placed + in a blob directory together with a manifest file. Note: this option is currently available + only for modern commerce scopes. + :paramtype partition_data: bool + """ + super(CommonExportProperties, self).__init__(**kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.run_history = run_history + self.partition_data = partition_data + self.next_run_time_estimate = None -class CommonExportProperties(msrest.serialization.Model): - """The common properties of the export. +class Resource(msrest.serialization.Model): + """The Resource model definition. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Location of the resource. + :vartype location: str + :ivar sku: SKU of the resource. + :vartype sku: str + :ivar e_tag: ETag of the resource. + :vartype e_tag: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { - 'delivery_info': {'required': True}, - 'definition': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'e_tag': {'readonly': True}, + 'tags': {'readonly': True}, } _attribute_map = { - 'format': {'key': 'format', 'type': 'str'}, - 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, - *, - delivery_info: "ExportDeliveryInfo", - definition: "ExportDefinition", - format: Optional[Union[str, "FormatType"]] = None, **kwargs ): - super(CommonExportProperties, self).__init__(**kwargs) - self.format = format - self.delivery_info = delivery_info - self.definition = definition + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.sku = None + self.e_tag = None + self.tags = None class Dimension(Resource): - """Dimension. + """List of Dimension. Variables are only populated by the server, and will be ignored when sending a request. @@ -421,6 +586,12 @@ class Dimension(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar location: Location of the resource. + :vartype location: str + :ivar sku: SKU of the resource. + :vartype sku: str + :ivar e_tag: ETag of the resource. + :vartype e_tag: str :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar description: Dimension description. @@ -429,8 +600,8 @@ class Dimension(Resource): :vartype filter_enabled: bool :ivar grouping_enabled: Grouping enabled. :vartype grouping_enabled: bool - :param data: - :type data: list[str] + :ivar data: Dimension data. + :vartype data: list[str] :ivar total: Total number of data for the dimension. :vartype total: int :ivar category: Dimension category. @@ -447,6 +618,9 @@ class Dimension(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'sku': {'readonly': True}, + 'e_tag': {'readonly': True}, 'tags': {'readonly': True}, 'description': {'readonly': True}, 'filter_enabled': {'readonly': True}, @@ -462,6 +636,9 @@ class Dimension(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'filter_enabled': {'key': 'properties.filterEnabled', 'type': 'bool'}, @@ -480,6 +657,10 @@ def __init__( data: Optional[List[str]] = None, **kwargs ): + """ + :keyword data: Dimension data. + :paramtype data: list[str] + """ super(Dimension, self).__init__(**kwargs) self.description = None self.filter_enabled = None @@ -513,6 +694,8 @@ def __init__( self, **kwargs ): + """ + """ super(DimensionsListResult, self).__init__(**kwargs) self.value = None @@ -520,29 +703,29 @@ def __init__( class DismissAlertPayload(msrest.serialization.Model): """The request payload to update an alert. - :param definition: defines the type of alert. - :type definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition - :param description: Alert description. - :type description: str - :param source: Source of alert. Possible values include: "Preset", "User". - :type source: str or ~azure.mgmt.costmanagement.models.AlertSource - :param details: Alert details. - :type details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails - :param cost_entity_id: related budget. - :type cost_entity_id: str - :param status: alert status. Possible values include: "None", "Active", "Overridden", + :ivar definition: defines the type of alert. + :vartype definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :ivar description: Alert description. + :vartype description: str + :ivar source: Source of alert. Possible values include: "Preset", "User". + :vartype source: str or ~azure.mgmt.costmanagement.models.AlertSource + :ivar details: Alert details. + :vartype details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :ivar cost_entity_id: related budget. + :vartype cost_entity_id: str + :ivar status: alert status. Possible values include: "None", "Active", "Overridden", "Resolved", "Dismissed". - :type status: str or ~azure.mgmt.costmanagement.models.AlertStatus - :param creation_time: dateTime in which alert was created. - :type creation_time: str - :param close_time: dateTime in which alert was closed. - :type close_time: str - :param modification_time: dateTime in which alert was last modified. - :type modification_time: str - :param status_modification_user_name: - :type status_modification_user_name: str - :param status_modification_time: dateTime in which the alert status was last modified. - :type status_modification_time: str + :vartype status: str or ~azure.mgmt.costmanagement.models.AlertStatus + :ivar creation_time: dateTime in which alert was created. + :vartype creation_time: str + :ivar close_time: dateTime in which alert was closed. + :vartype close_time: str + :ivar modification_time: dateTime in which alert was last modified. + :vartype modification_time: str + :ivar status_modification_user_name: User who last modified the alert. + :vartype status_modification_user_name: str + :ivar status_modification_time: dateTime in which the alert status was last modified. + :vartype status_modification_time: str """ _attribute_map = { @@ -575,6 +758,31 @@ def __init__( status_modification_time: Optional[str] = None, **kwargs ): + """ + :keyword definition: defines the type of alert. + :paramtype definition: ~azure.mgmt.costmanagement.models.AlertPropertiesDefinition + :keyword description: Alert description. + :paramtype description: str + :keyword source: Source of alert. Possible values include: "Preset", "User". + :paramtype source: str or ~azure.mgmt.costmanagement.models.AlertSource + :keyword details: Alert details. + :paramtype details: ~azure.mgmt.costmanagement.models.AlertPropertiesDetails + :keyword cost_entity_id: related budget. + :paramtype cost_entity_id: str + :keyword status: alert status. Possible values include: "None", "Active", "Overridden", + "Resolved", "Dismissed". + :paramtype status: str or ~azure.mgmt.costmanagement.models.AlertStatus + :keyword creation_time: dateTime in which alert was created. + :paramtype creation_time: str + :keyword close_time: dateTime in which alert was closed. + :paramtype close_time: str + :keyword modification_time: dateTime in which alert was last modified. + :paramtype modification_time: str + :keyword status_modification_user_name: User who last modified the alert. + :paramtype status_modification_user_name: str + :keyword status_modification_time: dateTime in which the alert status was last modified. + :paramtype status_modification_time: str + """ super(DismissAlertPayload, self).__init__(**kwargs) self.definition = definition self.description = description @@ -614,6 +822,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None @@ -631,8 +841,8 @@ class ErrorResponse(msrest.serialization.Model): * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. - :param error: The details of the error. - :type error: ~azure.mgmt.costmanagement.models.ErrorDetails + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _attribute_map = { @@ -645,12 +855,16 @@ def __init__( error: Optional["ErrorDetails"] = None, **kwargs ): + """ + :keyword error: The details of the error. + :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ super(ErrorResponse, self).__init__(**kwargs) self.error = error -class ProxyResource(msrest.serialization.Model): - """The Resource model definition. +class Export(ProxyResource): + """An export resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -660,15 +874,34 @@ class ProxyResource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + :ivar e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - :type e_tag: str + :vartype e_tag: str + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :vartype format: str or ~azure.mgmt.costmanagement.models.FormatType + :ivar delivery_info: Has delivery information for the export. + :vartype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :ivar definition: Has the definition for the export. + :vartype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :ivar run_history: If requested, has the most recent execution history for the export. + :vartype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar partition_data: If set to true, exported data will be partitioned by size and placed in a + blob directory together with a manifest file. Note: this option is currently available only for + modern commerce scopes. + :vartype partition_data: bool + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :ivar schedule: Has schedule information for the export. + :vartype schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { @@ -676,95 +909,137 @@ class ProxyResource(msrest.serialization.Model): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'format': {'key': 'properties.format', 'type': 'str'}, + 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, + 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'properties.runHistory', 'type': 'ExportExecutionListResult'}, + 'partition_data': {'key': 'properties.partitionData', 'type': 'bool'}, + 'next_run_time_estimate': {'key': 'properties.nextRunTimeEstimate', 'type': 'iso-8601'}, + 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, } def __init__( self, *, e_tag: Optional[str] = None, + format: Optional[Union[str, "FormatType"]] = None, + delivery_info: Optional["ExportDeliveryInfo"] = None, + definition: Optional["ExportDefinition"] = None, + run_history: Optional["ExportExecutionListResult"] = None, + partition_data: Optional[bool] = None, + schedule: Optional["ExportSchedule"] = None, **kwargs ): - super(ProxyResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.e_tag = e_tag - + """ + :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :paramtype e_tag: str + :keyword format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType + :keyword delivery_info: Has delivery information for the export. + :paramtype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :keyword definition: Has the definition for the export. + :paramtype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :keyword run_history: If requested, has the most recent execution history for the export. + :paramtype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :keyword partition_data: If set to true, exported data will be partitioned by size and placed + in a blob directory together with a manifest file. Note: this option is currently available + only for modern commerce scopes. + :paramtype partition_data: bool + :keyword schedule: Has schedule information for the export. + :paramtype schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + super(Export, self).__init__(e_tag=e_tag, **kwargs) + self.format = format + self.delivery_info = delivery_info + self.definition = definition + self.run_history = run_history + self.partition_data = partition_data + self.next_run_time_estimate = None + self.schedule = schedule -class Export(ProxyResource): - """A export resource. - Variables are only populated by the server, and will be ignored when sending a request. +class ExportDataset(msrest.serialization.Model): + """The definition for data in the export. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + :ivar granularity: The granularity of rows in the export. Currently only 'Daily' is supported. + Possible values include: "Daily". + :vartype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :ivar configuration: The export dataset configuration. + :vartype configuration: ~azure.mgmt.costmanagement.models.ExportDatasetConfiguration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'ExportDatasetConfiguration'}, } + def __init__( + self, + *, + granularity: Optional[Union[str, "GranularityType"]] = None, + configuration: Optional["ExportDatasetConfiguration"] = None, + **kwargs + ): + """ + :keyword granularity: The granularity of rows in the export. Currently only 'Daily' is + supported. Possible values include: "Daily". + :paramtype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :keyword configuration: The export dataset configuration. + :paramtype configuration: ~azure.mgmt.costmanagement.models.ExportDatasetConfiguration + """ + super(ExportDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + + +class ExportDatasetConfiguration(msrest.serialization.Model): + """The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns. + + :ivar columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :vartype columns: list[str] + """ + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'format': {'key': 'properties.format', 'type': 'str'}, - 'delivery_info': {'key': 'properties.deliveryInfo', 'type': 'ExportDeliveryInfo'}, - 'definition': {'key': 'properties.definition', 'type': 'ExportDefinition'}, - 'schedule': {'key': 'properties.schedule', 'type': 'ExportSchedule'}, + 'columns': {'key': 'columns', 'type': '[str]'}, } def __init__( self, *, - e_tag: Optional[str] = None, - format: Optional[Union[str, "FormatType"]] = None, - delivery_info: Optional["ExportDeliveryInfo"] = None, - definition: Optional["ExportDefinition"] = None, - schedule: Optional["ExportSchedule"] = None, + columns: Optional[List[str]] = None, **kwargs ): - super(Export, self).__init__(e_tag=e_tag, **kwargs) - self.format = format - self.delivery_info = delivery_info - self.definition = definition - self.schedule = schedule + """ + :keyword columns: Array of column names to be included in the export. If not provided then the + export will include all available columns. The available columns can vary by customer channel + (see examples). + :paramtype columns: list[str] + """ + super(ExportDatasetConfiguration, self).__init__(**kwargs) + self.columns = columns class ExportDefinition(msrest.serialization.Model): - """The definition of a query. + """The definition of an export. All required parameters must be populated in order to send to Azure. - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", - "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :ivar type: Required. The type of the export. Note that 'Usage' is equivalent to 'ActualCost' + and is applicable to exports that do not yet provide data for charges or amortization for + service reservations. Possible values include: "Usage", "ActualCost", "AmortizedCost". + :vartype type: str or ~azure.mgmt.costmanagement.models.ExportType + :ivar timeframe: Required. The time frame for pulling data for the export. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param data_set: Has definition for data in this query. - :type data_set: ~azure.mgmt.costmanagement.models.QueryDatasetAutoGenerated + :vartype timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :ivar time_period: Has time period for pulling data for the export. + :vartype time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod + :ivar data_set: The definition for data in the export. + :vartype data_set: ~azure.mgmt.costmanagement.models.ExportDataset """ _validation = { @@ -775,8 +1050,8 @@ class ExportDefinition(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, - 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'data_set': {'key': 'dataSet', 'type': 'QueryDatasetAutoGenerated'}, + 'time_period': {'key': 'timePeriod', 'type': 'ExportTimePeriod'}, + 'data_set': {'key': 'dataSet', 'type': 'ExportDataset'}, } def __init__( @@ -784,10 +1059,25 @@ def __init__( *, type: Union[str, "ExportType"], timeframe: Union[str, "TimeframeType"], - time_period: Optional["QueryTimePeriod"] = None, - data_set: Optional["QueryDatasetAutoGenerated"] = None, + time_period: Optional["ExportTimePeriod"] = None, + data_set: Optional["ExportDataset"] = None, **kwargs ): + """ + :keyword type: Required. The type of the export. Note that 'Usage' is equivalent to + 'ActualCost' and is applicable to exports that do not yet provide data for charges or + amortization for service reservations. Possible values include: "Usage", "ActualCost", + "AmortizedCost". + :paramtype type: str or ~azure.mgmt.costmanagement.models.ExportType + :keyword timeframe: Required. The time frame for pulling data for the export. If custom, then a + specific time period must be provided. Possible values include: "MonthToDate", + "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". + :paramtype timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :keyword time_period: Has time period for pulling data for the export. + :paramtype time_period: ~azure.mgmt.costmanagement.models.ExportTimePeriod + :keyword data_set: The definition for data in the export. + :paramtype data_set: ~azure.mgmt.costmanagement.models.ExportDataset + """ super(ExportDefinition, self).__init__(**kwargs) self.type = type self.timeframe = timeframe @@ -796,21 +1086,30 @@ def __init__( class ExportDeliveryDestination(msrest.serialization.Model): - """The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services . + """This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Azure Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ). All required parameters must be populated in order to send to Azure. - :param resource_id: Required. The resource id of the storage account where exports will be - delivered. - :type resource_id: str - :param container: Required. The name of the container where exports will be uploaded. - :type container: str - :param root_folder_path: The name of the directory where exports will be uploaded. - :type root_folder_path: str + :ivar resource_id: The resource id of the storage account where exports will be delivered. This + is not required if a sasToken and storageAccount are specified. + :vartype resource_id: str + :ivar container: Required. The name of the container where exports will be uploaded. If the + container does not exist it will be created. + :vartype container: str + :ivar root_folder_path: The name of the directory where exports will be uploaded. + :vartype root_folder_path: str + :ivar sas_token: A SAS token for the storage account. For a restricted set of Azure customers + this together with storageAccount can be specified instead of resourceId. Note: the value + returned by the API for this property will always be obfuscated. Returning this same obfuscated + value will not result in the SAS token being updated. To update this value a new SAS token must + be specified. + :vartype sas_token: str + :ivar storage_account: The storage account where exports will be uploaded. For a restricted set + of Azure customers this together with sasToken can be specified instead of resourceId. + :vartype storage_account: str """ _validation = { - 'resource_id': {'required': True}, 'container': {'required': True}, } @@ -818,20 +1117,45 @@ class ExportDeliveryDestination(msrest.serialization.Model): 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'container': {'key': 'container', 'type': 'str'}, 'root_folder_path': {'key': 'rootFolderPath', 'type': 'str'}, + 'sas_token': {'key': 'sasToken', 'type': 'str'}, + 'storage_account': {'key': 'storageAccount', 'type': 'str'}, } def __init__( self, *, - resource_id: str, container: str, + resource_id: Optional[str] = None, root_folder_path: Optional[str] = None, + sas_token: Optional[str] = None, + storage_account: Optional[str] = None, **kwargs ): + """ + :keyword resource_id: The resource id of the storage account where exports will be delivered. + This is not required if a sasToken and storageAccount are specified. + :paramtype resource_id: str + :keyword container: Required. The name of the container where exports will be uploaded. If the + container does not exist it will be created. + :paramtype container: str + :keyword root_folder_path: The name of the directory where exports will be uploaded. + :paramtype root_folder_path: str + :keyword sas_token: A SAS token for the storage account. For a restricted set of Azure + customers this together with storageAccount can be specified instead of resourceId. Note: the + value returned by the API for this property will always be obfuscated. Returning this same + obfuscated value will not result in the SAS token being updated. To update this value a new SAS + token must be specified. + :paramtype sas_token: str + :keyword storage_account: The storage account where exports will be uploaded. For a restricted + set of Azure customers this together with sasToken can be specified instead of resourceId. + :paramtype storage_account: str + """ super(ExportDeliveryDestination, self).__init__(**kwargs) self.resource_id = resource_id self.container = container self.root_folder_path = root_folder_path + self.sas_token = sas_token + self.storage_account = storage_account class ExportDeliveryInfo(msrest.serialization.Model): @@ -839,8 +1163,8 @@ class ExportDeliveryInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param destination: Required. Has destination for the export being delivered. - :type destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + :ivar destination: Required. Has destination for the export being delivered. + :vartype destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination """ _validation = { @@ -857,12 +1181,16 @@ def __init__( destination: "ExportDeliveryDestination", **kwargs ): + """ + :keyword destination: Required. Has destination for the export being delivered. + :paramtype destination: ~azure.mgmt.costmanagement.models.ExportDeliveryDestination + """ super(ExportDeliveryInfo, self).__init__(**kwargs) self.destination = destination -class ExportExecution(Resource): - """A export execution. +class ExportExecution(ProxyResource): + """An export execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -872,41 +1200,43 @@ class ExportExecution(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param execution_type: The type of the export execution. Possible values include: "OnDemand", + :ivar e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :vartype e_tag: str + :ivar execution_type: The type of the export execution. Possible values include: "OnDemand", "Scheduled". - :type execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType - :param status: The status of the export execution. Possible values include: "Queued", + :vartype execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType + :ivar status: The last known status of the export execution. Possible values include: "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", "DataNotAvailable". - :type status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus - :param submitted_by: The identifier for the entity that executed the export. For OnDemand - executions, it is the email id. For Scheduled executions, it is the constant value - System. - :type submitted_by: str - :param submitted_time: The time when export was queued to be executed. - :type submitted_time: ~datetime.datetime - :param processing_start_time: The time when export was picked up to be executed. - :type processing_start_time: ~datetime.datetime - :param processing_end_time: The time when export execution finished. - :type processing_end_time: ~datetime.datetime - :param file_name: The name of the file export got written to. - :type file_name: str - :param run_settings: The common properties of the export. - :type run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :vartype status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :ivar submitted_by: The identifier for the entity that executed the export. For OnDemand + executions it is the user email. For scheduled executions it is 'System'. + :vartype submitted_by: str + :ivar submitted_time: The time when export was queued to be executed. + :vartype submitted_time: ~datetime.datetime + :ivar processing_start_time: The time when export was picked up to be executed. + :vartype processing_start_time: ~datetime.datetime + :ivar processing_end_time: The time when the export execution finished. + :vartype processing_end_time: ~datetime.datetime + :ivar file_name: The name of the exported file. + :vartype file_name: str + :ivar run_settings: The export settings that were in effect for this execution. + :vartype run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :ivar error: The details of any error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, 'execution_type': {'key': 'properties.executionType', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'submitted_by': {'key': 'properties.submittedBy', 'type': 'str'}, @@ -915,11 +1245,13 @@ class ExportExecution(Resource): 'processing_end_time': {'key': 'properties.processingEndTime', 'type': 'iso-8601'}, 'file_name': {'key': 'properties.fileName', 'type': 'str'}, 'run_settings': {'key': 'properties.runSettings', 'type': 'CommonExportProperties'}, + 'error': {'key': 'properties.error', 'type': 'ErrorDetails'}, } def __init__( self, *, + e_tag: Optional[str] = None, execution_type: Optional[Union[str, "ExecutionType"]] = None, status: Optional[Union[str, "ExecutionStatus"]] = None, submitted_by: Optional[str] = None, @@ -928,9 +1260,37 @@ def __init__( processing_end_time: Optional[datetime.datetime] = None, file_name: Optional[str] = None, run_settings: Optional["CommonExportProperties"] = None, + error: Optional["ErrorDetails"] = None, **kwargs ): - super(ExportExecution, self).__init__(**kwargs) + """ + :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :paramtype e_tag: str + :keyword execution_type: The type of the export execution. Possible values include: "OnDemand", + "Scheduled". + :paramtype execution_type: str or ~azure.mgmt.costmanagement.models.ExecutionType + :keyword status: The last known status of the export execution. Possible values include: + "Queued", "InProgress", "Completed", "Failed", "Timeout", "NewDataNotAvailable", + "DataNotAvailable". + :paramtype status: str or ~azure.mgmt.costmanagement.models.ExecutionStatus + :keyword submitted_by: The identifier for the entity that executed the export. For OnDemand + executions it is the user email. For scheduled executions it is 'System'. + :paramtype submitted_by: str + :keyword submitted_time: The time when export was queued to be executed. + :paramtype submitted_time: ~datetime.datetime + :keyword processing_start_time: The time when export was picked up to be executed. + :paramtype processing_start_time: ~datetime.datetime + :keyword processing_end_time: The time when the export execution finished. + :paramtype processing_end_time: ~datetime.datetime + :keyword file_name: The name of the exported file. + :paramtype file_name: str + :keyword run_settings: The export settings that were in effect for this execution. + :paramtype run_settings: ~azure.mgmt.costmanagement.models.CommonExportProperties + :keyword error: The details of any error. + :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + super(ExportExecution, self).__init__(e_tag=e_tag, **kwargs) self.execution_type = execution_type self.status = status self.submitted_by = submitted_by @@ -939,14 +1299,15 @@ def __init__( self.processing_end_time = processing_end_time self.file_name = file_name self.run_settings = run_settings + self.error = error class ExportExecutionListResult(msrest.serialization.Model): - """Result of listing exports execution history of a export by name. + """Result of listing the execution history of an export. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of export executions. + :ivar value: A list of export executions. :vartype value: list[~azure.mgmt.costmanagement.models.ExportExecution] """ @@ -962,6 +1323,8 @@ def __init__( self, **kwargs ): + """ + """ super(ExportExecutionListResult, self).__init__(**kwargs) self.value = None @@ -987,6 +1350,8 @@ def __init__( self, **kwargs ): + """ + """ super(ExportListResult, self).__init__(**kwargs) self.value = None @@ -994,27 +1359,43 @@ def __init__( class ExportProperties(CommonExportProperties): """The properties of the export. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :param format: The format of the export being delivered. Possible values include: "Csv". - :type format: str or ~azure.mgmt.costmanagement.models.FormatType - :param delivery_info: Required. Has delivery information for the export. - :type delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo - :param definition: Required. Has definition for the export. - :type definition: ~azure.mgmt.costmanagement.models.ExportDefinition - :param schedule: Has schedule information for the export. - :type schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + :ivar format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :vartype format: str or ~azure.mgmt.costmanagement.models.FormatType + :ivar delivery_info: Required. Has delivery information for the export. + :vartype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :ivar definition: Required. Has the definition for the export. + :vartype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :ivar run_history: If requested, has the most recent execution history for the export. + :vartype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :ivar partition_data: If set to true, exported data will be partitioned by size and placed in a + blob directory together with a manifest file. Note: this option is currently available only for + modern commerce scopes. + :vartype partition_data: bool + :ivar next_run_time_estimate: If the export has an active schedule, provides an estimate of the + next execution time. + :vartype next_run_time_estimate: ~datetime.datetime + :ivar schedule: Has schedule information for the export. + :vartype schedule: ~azure.mgmt.costmanagement.models.ExportSchedule """ _validation = { 'delivery_info': {'required': True}, 'definition': {'required': True}, + 'next_run_time_estimate': {'readonly': True}, } _attribute_map = { 'format': {'key': 'format', 'type': 'str'}, 'delivery_info': {'key': 'deliveryInfo', 'type': 'ExportDeliveryInfo'}, 'definition': {'key': 'definition', 'type': 'ExportDefinition'}, + 'run_history': {'key': 'runHistory', 'type': 'ExportExecutionListResult'}, + 'partition_data': {'key': 'partitionData', 'type': 'bool'}, + 'next_run_time_estimate': {'key': 'nextRunTimeEstimate', 'type': 'iso-8601'}, 'schedule': {'key': 'schedule', 'type': 'ExportSchedule'}, } @@ -1024,10 +1405,29 @@ def __init__( delivery_info: "ExportDeliveryInfo", definition: "ExportDefinition", format: Optional[Union[str, "FormatType"]] = None, + run_history: Optional["ExportExecutionListResult"] = None, + partition_data: Optional[bool] = None, schedule: Optional["ExportSchedule"] = None, **kwargs ): - super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, **kwargs) + """ + :keyword format: The format of the export being delivered. Currently only 'Csv' is supported. + Possible values include: "Csv". + :paramtype format: str or ~azure.mgmt.costmanagement.models.FormatType + :keyword delivery_info: Required. Has delivery information for the export. + :paramtype delivery_info: ~azure.mgmt.costmanagement.models.ExportDeliveryInfo + :keyword definition: Required. Has the definition for the export. + :paramtype definition: ~azure.mgmt.costmanagement.models.ExportDefinition + :keyword run_history: If requested, has the most recent execution history for the export. + :paramtype run_history: ~azure.mgmt.costmanagement.models.ExportExecutionListResult + :keyword partition_data: If set to true, exported data will be partitioned by size and placed + in a blob directory together with a manifest file. Note: this option is currently available + only for modern commerce scopes. + :paramtype partition_data: bool + :keyword schedule: Has schedule information for the export. + :paramtype schedule: ~azure.mgmt.costmanagement.models.ExportSchedule + """ + super(ExportProperties, self).__init__(format=format, delivery_info=delivery_info, definition=definition, run_history=run_history, partition_data=partition_data, **kwargs) self.schedule = schedule @@ -1036,10 +1436,10 @@ class ExportRecurrencePeriod(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param from_property: Required. The start date of recurrence. - :type from_property: ~datetime.datetime - :param to: The end date of recurrence. - :type to: ~datetime.datetime + :ivar from_property: Required. The start date of recurrence. + :vartype from_property: ~datetime.datetime + :ivar to: The end date of recurrence. + :vartype to: ~datetime.datetime """ _validation = { @@ -1058,31 +1458,31 @@ def __init__( to: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword from_property: Required. The start date of recurrence. + :paramtype from_property: ~datetime.datetime + :keyword to: The end date of recurrence. + :paramtype to: ~datetime.datetime + """ super(ExportRecurrencePeriod, self).__init__(**kwargs) self.from_property = from_property self.to = to class ExportSchedule(msrest.serialization.Model): - """The schedule associated with a export. - - All required parameters must be populated in order to send to Azure. - - :param status: The status of the schedule. Whether active or not. If inactive, the export's - scheduled execution is paused. Possible values include: "Active", "Inactive". - :type status: str or ~azure.mgmt.costmanagement.models.StatusType - :param recurrence: Required. The schedule recurrence. Possible values include: "Daily", - "Weekly", "Monthly", "Annually". - :type recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType - :param recurrence_period: Has start and end date of the recurrence. The start date must be in + """The schedule associated with the export. + + :ivar status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :vartype status: str or ~azure.mgmt.costmanagement.models.StatusType + :ivar recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", + "Monthly", "Annually". + :vartype recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :ivar recurrence_period: Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date. - :type recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + :vartype recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod """ - _validation = { - 'recurrence': {'required': True}, - } - _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'recurrence': {'key': 'recurrence', 'type': 'str'}, @@ -1092,37 +1492,140 @@ class ExportSchedule(msrest.serialization.Model): def __init__( self, *, - recurrence: Union[str, "RecurrenceType"], status: Optional[Union[str, "StatusType"]] = None, + recurrence: Optional[Union[str, "RecurrenceType"]] = None, recurrence_period: Optional["ExportRecurrencePeriod"] = None, **kwargs ): + """ + :keyword status: The status of the export's schedule. If 'Inactive', the export's schedule is + paused. Possible values include: "Active", "Inactive". + :paramtype status: str or ~azure.mgmt.costmanagement.models.StatusType + :keyword recurrence: The schedule recurrence. Possible values include: "Daily", "Weekly", + "Monthly", "Annually". + :paramtype recurrence: str or ~azure.mgmt.costmanagement.models.RecurrenceType + :keyword recurrence_period: Has start and end date of the recurrence. The start date must be in + future. If present, the end date must be greater than start date. + :paramtype recurrence_period: ~azure.mgmt.costmanagement.models.ExportRecurrencePeriod + """ super(ExportSchedule, self).__init__(**kwargs) self.status = status self.recurrence = recurrence self.recurrence_period = recurrence_period +class ExportTimePeriod(msrest.serialization.Model): + """The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months. + + All required parameters must be populated in order to send to Azure. + + :ivar from_property: Required. The start date for export data. + :vartype from_property: ~datetime.datetime + :ivar to: Required. The end date for export data. + :vartype to: ~datetime.datetime + """ + + _validation = { + 'from_property': {'required': True}, + 'to': {'required': True}, + } + + _attribute_map = { + 'from_property': {'key': 'from', 'type': 'iso-8601'}, + 'to': {'key': 'to', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + from_property: datetime.datetime, + to: datetime.datetime, + **kwargs + ): + """ + :keyword from_property: Required. The start date for export data. + :paramtype from_property: ~datetime.datetime + :keyword to: Required. The end date for export data. + :paramtype to: ~datetime.datetime + """ + super(ExportTimePeriod, self).__init__(**kwargs) + self.from_property = from_property + self.to = to + + +class ForecastDataset(msrest.serialization.Model): + """The definition of data present in the forecast. + + :ivar granularity: The granularity of rows in the forecast. Possible values include: "Daily". + :vartype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :ivar configuration: Has configuration information for the data in the export. The + configuration will be ignored if aggregation and grouping are provided. + :vartype configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :ivar aggregation: Dictionary of aggregation expression to use in the forecast. The key of each + item in the dictionary is the alias for the aggregated column. forecast can have up to 2 + aggregation clauses. + :vartype aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :ivar filter: Has filter expression to use in the forecast. + :vartype filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + + _attribute_map = { + 'granularity': {'key': 'granularity', 'type': 'str'}, + 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, + 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, + 'filter': {'key': 'filter', 'type': 'QueryFilter'}, + } + + def __init__( + self, + *, + granularity: Optional[Union[str, "GranularityType"]] = None, + configuration: Optional["QueryDatasetConfiguration"] = None, + aggregation: Optional[Dict[str, "QueryAggregation"]] = None, + filter: Optional["QueryFilter"] = None, + **kwargs + ): + """ + :keyword granularity: The granularity of rows in the forecast. Possible values include: + "Daily". + :paramtype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :keyword configuration: Has configuration information for the data in the export. The + configuration will be ignored if aggregation and grouping are provided. + :paramtype configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :keyword aggregation: Dictionary of aggregation expression to use in the forecast. The key of + each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 + aggregation clauses. + :paramtype aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :keyword filter: Has filter expression to use in the forecast. + :paramtype filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ + super(ForecastDataset, self).__init__(**kwargs) + self.granularity = granularity + self.configuration = configuration + self.aggregation = aggregation + self.filter = filter + + class ForecastDefinition(msrest.serialization.Model): """The definition of a forecast. All required parameters must be populated in order to send to Azure. - :param type: Required. The type of the forecast. Possible values include: "Usage", - "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ForecastType - :param timeframe: Required. The time frame for pulling data for the forecast. If custom, then a + :ivar type: Required. The type of the forecast. Possible values include: "Usage", "ActualCost", + "AmortizedCost". + :vartype type: str or ~azure.mgmt.costmanagement.models.ForecastType + :ivar timeframe: Required. The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType - :param time_period: Has time period for pulling data for the forecast. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Required. Has definition for data in this forecast. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset - :param include_actual_cost: a boolean determining if actualCost will be included. - :type include_actual_cost: bool - :param include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. - :type include_fresh_partial_cost: bool + :vartype timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :ivar time_period: Has time period for pulling data for the forecast. + :vartype time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :ivar dataset: Required. Has definition for data in this forecast. + :vartype dataset: ~azure.mgmt.costmanagement.models.ForecastDataset + :ivar include_actual_cost: a boolean determining if actualCost will be included. + :vartype include_actual_cost: bool + :ivar include_fresh_partial_cost: a boolean determining if FreshPartialCost will be included. + :vartype include_fresh_partial_cost: bool """ _validation = { @@ -1135,7 +1638,7 @@ class ForecastDefinition(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'timeframe': {'key': 'timeframe', 'type': 'str'}, 'time_period': {'key': 'timePeriod', 'type': 'QueryTimePeriod'}, - 'dataset': {'key': 'dataset', 'type': 'QueryDataset'}, + 'dataset': {'key': 'dataset', 'type': 'ForecastDataset'}, 'include_actual_cost': {'key': 'includeActualCost', 'type': 'bool'}, 'include_fresh_partial_cost': {'key': 'includeFreshPartialCost', 'type': 'bool'}, } @@ -1145,12 +1648,30 @@ def __init__( *, type: Union[str, "ForecastType"], timeframe: Union[str, "ForecastTimeframeType"], - dataset: "QueryDataset", + dataset: "ForecastDataset", time_period: Optional["QueryTimePeriod"] = None, include_actual_cost: Optional[bool] = None, include_fresh_partial_cost: Optional[bool] = None, **kwargs ): + """ + :keyword type: Required. The type of the forecast. Possible values include: "Usage", + "ActualCost", "AmortizedCost". + :paramtype type: str or ~azure.mgmt.costmanagement.models.ForecastType + :keyword timeframe: Required. The time frame for pulling data for the forecast. If custom, then + a specific time period must be provided. Possible values include: "MonthToDate", + "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". + :paramtype timeframe: str or ~azure.mgmt.costmanagement.models.ForecastTimeframeType + :keyword time_period: Has time period for pulling data for the forecast. + :paramtype time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :keyword dataset: Required. Has definition for data in this forecast. + :paramtype dataset: ~azure.mgmt.costmanagement.models.ForecastDataset + :keyword include_actual_cost: a boolean determining if actualCost will be included. + :paramtype include_actual_cost: bool + :keyword include_fresh_partial_cost: a boolean determining if FreshPartialCost will be + included. + :paramtype include_fresh_partial_cost: bool + """ super(ForecastDefinition, self).__init__(**kwargs) self.type = type self.timeframe = timeframe @@ -1160,20 +1681,290 @@ def __init__( self.include_fresh_partial_cost = include_fresh_partial_cost -class KpiProperties(msrest.serialization.Model): - """Each KPI must contain a 'type' and 'enabled' key. - - :param type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". - :type type: str or ~azure.mgmt.costmanagement.models.KpiType - :param id: ID of resource related to metric (budget). - :type id: str - :param enabled: show the KPI in the UI?. - :type enabled: bool +class GenerateDetailedCostReportDefinition(msrest.serialization.Model): + """The definition of a cost detailed report. + + :ivar metric: The type of the detailed report. By default ActualCost is provided. Possible + values include: "ActualCost", "AmortizedCost". + :vartype metric: str or ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportMetricType + :ivar time_period: Has time period for pulling data for the cost detailed report. Can only have + one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current + month cost is provided. + :vartype time_period: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportTimePeriod + :ivar billing_period: Billing Period in YearMonth(e.g. 202008) format. Only for legacy + enterprise customers can use this. Can only have one of either timePeriod or invoiceId or + billingPeriod parameters. If none provided current month cost is provided. + :vartype billing_period: str + :ivar invoice_id: Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can + only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided + current month cost is provided. + :vartype invoice_id: str + :ivar customer_id: Customer Id for Modern (Invoice Id and billing profile is also required for + this). + :vartype customer_id: str """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, + 'metric': {'key': 'metric', 'type': 'str'}, + 'time_period': {'key': 'timePeriod', 'type': 'GenerateDetailedCostReportTimePeriod'}, + 'billing_period': {'key': 'billingPeriod', 'type': 'str'}, + 'invoice_id': {'key': 'invoiceId', 'type': 'str'}, + 'customer_id': {'key': 'customerId', 'type': 'str'}, + } + + def __init__( + self, + *, + metric: Optional[Union[str, "GenerateDetailedCostReportMetricType"]] = None, + time_period: Optional["GenerateDetailedCostReportTimePeriod"] = None, + billing_period: Optional[str] = None, + invoice_id: Optional[str] = None, + customer_id: Optional[str] = None, + **kwargs + ): + """ + :keyword metric: The type of the detailed report. By default ActualCost is provided. Possible + values include: "ActualCost", "AmortizedCost". + :paramtype metric: str or + ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportMetricType + :keyword time_period: Has time period for pulling data for the cost detailed report. Can only + have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided + current month cost is provided. + :paramtype time_period: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportTimePeriod + :keyword billing_period: Billing Period in YearMonth(e.g. 202008) format. Only for legacy + enterprise customers can use this. Can only have one of either timePeriod or invoiceId or + billingPeriod parameters. If none provided current month cost is provided. + :paramtype billing_period: str + :keyword invoice_id: Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can + only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided + current month cost is provided. + :paramtype invoice_id: str + :keyword customer_id: Customer Id for Modern (Invoice Id and billing profile is also required + for this). + :paramtype customer_id: str + """ + super(GenerateDetailedCostReportDefinition, self).__init__(**kwargs) + self.metric = metric + self.time_period = time_period + self.billing_period = billing_period + self.invoice_id = invoice_id + self.customer_id = customer_id + + +class GenerateDetailedCostReportErrorResponse(msrest.serialization.Model): + """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + +Some Error responses: + + +* + 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead. + +* + 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header. + +* + 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header. + + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetails"] = None, + **kwargs + ): + """ + :keyword error: The details of the error. + :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails + """ + super(GenerateDetailedCostReportErrorResponse, self).__init__(**kwargs) + self.error = error + + +class GenerateDetailedCostReportOperationResult(msrest.serialization.Model): + """The result of the long running operation for cost detailed report. + + :ivar id: The id of the long running operation. + :vartype id: str + :ivar name: The name of the long running operation. + :vartype name: str + :ivar type: The type of the long running operation. + :vartype type: str + :ivar download_url: The URL to download the generated report. + :vartype download_url: str + :ivar valid_till: The time at which report URL becomes invalid/expires in UTC e.g. + 2020-12-08T05:55:59.4394737Z. + :vartype valid_till: ~datetime.datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, + 'valid_till': {'key': 'properties.validTill', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + download_url: Optional[str] = None, + valid_till: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword id: The id of the long running operation. + :paramtype id: str + :keyword name: The name of the long running operation. + :paramtype name: str + :keyword type: The type of the long running operation. + :paramtype type: str + :keyword download_url: The URL to download the generated report. + :paramtype download_url: str + :keyword valid_till: The time at which report URL becomes invalid/expires in UTC e.g. + 2020-12-08T05:55:59.4394737Z. + :paramtype valid_till: ~datetime.datetime + """ + super(GenerateDetailedCostReportOperationResult, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.download_url = download_url + self.valid_till = valid_till + + +class GenerateDetailedCostReportOperationStatuses(msrest.serialization.Model): + """The status of the long running operation for cost detailed report. + + :ivar id: The id of the long running operation. + :vartype id: str + :ivar name: The name of the long running operation. + :vartype name: str + :ivar status: The status of the long running operation. + :vartype status: ~azure.mgmt.costmanagement.models.Status + :ivar type: The type of the long running operation. + :vartype type: str + :ivar error: The details of the error. + :vartype error: ~azure.mgmt.costmanagement.models.ErrorDetails + :ivar download_url: The URL to download the generated report. + :vartype download_url: str + :ivar valid_till: The time at which report URL becomes invalid/expires in UTC e.g. + 2020-12-08T05:55:59.4394737Z. + :vartype valid_till: ~datetime.datetime + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'Status'}, + 'type': {'key': 'type', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + 'download_url': {'key': 'properties.downloadUrl', 'type': 'str'}, + 'valid_till': {'key': 'properties.validTill', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional["Status"] = None, + type: Optional[str] = None, + error: Optional["ErrorDetails"] = None, + download_url: Optional[str] = None, + valid_till: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword id: The id of the long running operation. + :paramtype id: str + :keyword name: The name of the long running operation. + :paramtype name: str + :keyword status: The status of the long running operation. + :paramtype status: ~azure.mgmt.costmanagement.models.Status + :keyword type: The type of the long running operation. + :paramtype type: str + :keyword error: The details of the error. + :paramtype error: ~azure.mgmt.costmanagement.models.ErrorDetails + :keyword download_url: The URL to download the generated report. + :paramtype download_url: str + :keyword valid_till: The time at which report URL becomes invalid/expires in UTC e.g. + 2020-12-08T05:55:59.4394737Z. + :paramtype valid_till: ~datetime.datetime + """ + super(GenerateDetailedCostReportOperationStatuses, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.type = type + self.error = error + self.download_url = download_url + self.valid_till = valid_till + + +class GenerateDetailedCostReportTimePeriod(msrest.serialization.Model): + """The start and end date for pulling data for the cost detailed report. + + All required parameters must be populated in order to send to Azure. + + :ivar start: Required. The start date to pull data from. example format 2020-03-15. + :vartype start: str + :ivar end: Required. The end date to pull data to. example format 2020-03-15. + :vartype end: str + """ + + _validation = { + 'start': {'required': True}, + 'end': {'required': True}, + } + + _attribute_map = { + 'start': {'key': 'start', 'type': 'str'}, + 'end': {'key': 'end', 'type': 'str'}, + } + + def __init__( + self, + *, + start: str, + end: str, + **kwargs + ): + """ + :keyword start: Required. The start date to pull data from. example format 2020-03-15. + :paramtype start: str + :keyword end: Required. The end date to pull data to. example format 2020-03-15. + :paramtype end: str + """ + super(GenerateDetailedCostReportTimePeriod, self).__init__(**kwargs) + self.start = start + self.end = end + + +class KpiProperties(msrest.serialization.Model): + """Each KPI must contain a 'type' and 'enabled' key. + + :ivar type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". + :vartype type: str or ~azure.mgmt.costmanagement.models.KpiType + :ivar id: ID of resource related to metric (budget). + :vartype id: str + :ivar enabled: show the KPI in the UI?. + :vartype enabled: bool + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, } @@ -1185,6 +1976,14 @@ def __init__( enabled: Optional[bool] = None, **kwargs ): + """ + :keyword type: KPI type (Forecast, Budget). Possible values include: "Forecast", "Budget". + :paramtype type: str or ~azure.mgmt.costmanagement.models.KpiType + :keyword id: ID of resource related to metric (budget). + :paramtype id: str + :keyword enabled: show the KPI in the UI?. + :paramtype enabled: bool + """ super(KpiProperties, self).__init__(**kwargs) self.type = type self.id = id @@ -1196,17 +1995,21 @@ class Operation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Operation id: {provider}/{resource}/{operation}. + :vartype id: str :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.costmanagement.models.OperationDisplay + :ivar display: The object that represents the operation. + :vartype display: ~azure.mgmt.costmanagement.models.OperationDisplay """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, } @@ -1217,7 +2020,12 @@ def __init__( display: Optional["OperationDisplay"] = None, **kwargs ): + """ + :keyword display: The object that represents the operation. + :paramtype display: ~azure.mgmt.costmanagement.models.OperationDisplay + """ super(Operation, self).__init__(**kwargs) + self.id = None self.name = None self.display = display @@ -1233,28 +2041,35 @@ class OperationDisplay(msrest.serialization.Model): :vartype resource: str :ivar operation: Operation type: Read, write, delete, etc. :vartype operation: str + :ivar description: Operation description. + :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + """ super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None + self.description = None class OperationListResult(msrest.serialization.Model): @@ -1283,6 +2098,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationListResult, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1291,16 +2108,17 @@ def __init__( class OperationStatus(msrest.serialization.Model): """The status of the long running operation. - :param status: The status of the long running operation. - :type status: ~azure.mgmt.costmanagement.models.Status - :param report_url: The URL to download the generated report. - :type report_url: str - :param valid_until: The time at which report URL becomes invalid. - :type valid_until: ~datetime.datetime + :ivar status: The status of the long running operation. Possible values include: "Running", + "Completed", "Failed". + :vartype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType + :ivar report_url: The URL to download the generated report. + :vartype report_url: str + :ivar valid_until: The time at which report URL becomes invalid. + :vartype valid_until: ~datetime.datetime """ _attribute_map = { - 'status': {'key': 'status', 'type': 'Status'}, + 'status': {'key': 'status', 'type': 'str'}, 'report_url': {'key': 'properties.reportUrl', 'type': 'str'}, 'valid_until': {'key': 'properties.validUntil', 'type': 'iso-8601'}, } @@ -1308,11 +2126,20 @@ class OperationStatus(msrest.serialization.Model): def __init__( self, *, - status: Optional["Status"] = None, + status: Optional[Union[str, "OperationStatusType"]] = None, report_url: Optional[str] = None, valid_until: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword status: The status of the long running operation. Possible values include: "Running", + "Completed", "Failed". + :paramtype status: str or ~azure.mgmt.costmanagement.models.OperationStatusType + :keyword report_url: The URL to download the generated report. + :paramtype report_url: str + :keyword valid_until: The time at which report URL becomes invalid. + :paramtype valid_until: ~datetime.datetime + """ super(OperationStatus, self).__init__(**kwargs) self.status = status self.report_url = report_url @@ -1322,10 +2149,10 @@ def __init__( class PivotProperties(msrest.serialization.Model): """Each pivot must contain a 'type' and 'name'. - :param type: Data type to show in view. Possible values include: "Dimension", "TagKey". - :type type: str or ~azure.mgmt.costmanagement.models.PivotType - :param name: Data field to show in view. - :type name: str + :ivar type: Data type to show in view. Possible values include: "Dimension", "TagKey". + :vartype type: str or ~azure.mgmt.costmanagement.models.PivotType + :ivar name: Data field to show in view. + :vartype name: str """ _attribute_map = { @@ -1340,61 +2167,27 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword type: Data type to show in view. Possible values include: "Dimension", "TagKey". + :paramtype type: str or ~azure.mgmt.costmanagement.models.PivotType + :keyword name: Data field to show in view. + :paramtype name: str + """ super(PivotProperties, self).__init__(**kwargs) self.type = type self.name = name -class ProxySettingResource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxySettingResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.kind = None - self.type = None - - class QueryAggregation(msrest.serialization.Model): """The aggregation expression to be used in the query. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to aggregate. - :type name: str - :param function: Required. The name of the aggregation function to use. Possible values - include: "Avg", "Max", "Min", "Sum". - :type function: str or ~azure.mgmt.costmanagement.models.FunctionType + :ivar name: Required. The name of the column to aggregate. + :vartype name: str + :ivar function: Required. The name of the aggregation function to use. Possible values include: + "Sum". + :vartype function: str or ~azure.mgmt.costmanagement.models.FunctionType """ _validation = { @@ -1414,18 +2207,25 @@ def __init__( function: Union[str, "FunctionType"], **kwargs ): + """ + :keyword name: Required. The name of the column to aggregate. + :paramtype name: str + :keyword function: Required. The name of the aggregation function to use. Possible values + include: "Sum". + :paramtype function: str or ~azure.mgmt.costmanagement.models.FunctionType + """ super(QueryAggregation, self).__init__(**kwargs) self.name = name self.function = function class QueryColumn(msrest.serialization.Model): - """QueryColumn. + """QueryColumn properties. - :param name: The name of column. - :type name: str - :param type: The type of column. - :type type: str + :ivar name: The name of column. + :vartype name: str + :ivar type: The type of column. + :vartype type: str """ _attribute_map = { @@ -1440,6 +2240,12 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword name: The name of column. + :paramtype name: str + :keyword type: The type of column. + :paramtype type: str + """ super(QueryColumn, self).__init__(**kwargs) self.name = name self.type = type @@ -1450,13 +2256,12 @@ class QueryComparisonExpression(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to use in comparison. - :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", - "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType - :param values: Required. Array of values to use for comparison. - :type values: list[str] + :ivar name: Required. The name of the column to use in comparison. + :vartype name: str + :ivar operator: Required. The operator to use for comparison. Possible values include: "In". + :vartype operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType + :ivar values: Required. Array of values to use for comparison. + :vartype values: list[str] """ _validation = { @@ -1475,10 +2280,18 @@ def __init__( self, *, name: str, - operator: Union[str, "OperatorType"], + operator: Union[str, "QueryOperatorType"], values: List[str], **kwargs ): + """ + :keyword name: Required. The name of the column to use in comparison. + :paramtype name: str + :keyword operator: Required. The operator to use for comparison. Possible values include: "In". + :paramtype operator: str or ~azure.mgmt.costmanagement.models.QueryOperatorType + :keyword values: Required. Array of values to use for comparison. + :paramtype values: list[str] + """ super(QueryComparisonExpression, self).__init__(**kwargs) self.name = name self.operator = operator @@ -1488,21 +2301,21 @@ def __init__( class QueryDataset(msrest.serialization.Model): """The definition of data present in the query. - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The + :ivar granularity: The granularity of rows in the query. Possible values include: "Daily". + :vartype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :ivar configuration: Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each + :vartype configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :ivar aggregation: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group + :vartype aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :ivar grouping: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: The filter expression to use in the query. Please reference our Query API REST + :vartype grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :ivar filter: The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format the filter. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilter + :vartype filter: ~azure.mgmt.costmanagement.models.QueryFilter """ _validation = { @@ -1527,6 +2340,23 @@ def __init__( filter: Optional["QueryFilter"] = None, **kwargs ): + """ + :keyword granularity: The granularity of rows in the query. Possible values include: "Daily". + :paramtype granularity: str or ~azure.mgmt.costmanagement.models.GranularityType + :keyword configuration: Has configuration information for the data in the export. The + configuration will be ignored if aggregation and grouping are provided. + :paramtype configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration + :keyword aggregation: Dictionary of aggregation expression to use in the query. The key of each + item in the dictionary is the alias for the aggregated column. Query can have up to 2 + aggregation clauses. + :paramtype aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] + :keyword grouping: Array of group by expression to use in the query. Query can have up to 2 + group by clauses. + :paramtype grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] + :keyword filter: The filter expression to use in the query. Please reference our Query API REST + documentation for how to properly format the filter. + :paramtype filter: ~azure.mgmt.costmanagement.models.QueryFilter + """ super(QueryDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration @@ -1535,62 +2365,12 @@ def __init__( self.filter = filter -class QueryDatasetAutoGenerated(msrest.serialization.Model): - """The definition of data present in the query. - - :param granularity: The granularity of rows in the query. Possible values include: "Daily". - :type granularity: str or ~azure.mgmt.costmanagement.models.GranularityType - :param configuration: Has configuration information for the data in the export. The - configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.QueryDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the query. The key of each - item in the dictionary is the alias for the aggregated column. Query can have up to 2 - aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.QueryAggregation] - :param grouping: Array of group by expression to use in the query. Query can have up to 2 group - by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.QueryGrouping] - :param filter: The filter expression to use in the query. Please reference our Query API REST - documentation for how to properly format the filter. - :type filter: ~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated - """ - - _validation = { - 'grouping': {'max_items': 2, 'min_items': 0}, - } - - _attribute_map = { - 'granularity': {'key': 'granularity', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': 'QueryDatasetConfiguration'}, - 'aggregation': {'key': 'aggregation', 'type': '{QueryAggregation}'}, - 'grouping': {'key': 'grouping', 'type': '[QueryGrouping]'}, - 'filter': {'key': 'filter', 'type': 'QueryFilterAutoGenerated'}, - } - - def __init__( - self, - *, - granularity: Optional[Union[str, "GranularityType"]] = None, - configuration: Optional["QueryDatasetConfiguration"] = None, - aggregation: Optional[Dict[str, "QueryAggregation"]] = None, - grouping: Optional[List["QueryGrouping"]] = None, - filter: Optional["QueryFilterAutoGenerated"] = None, - **kwargs - ): - super(QueryDatasetAutoGenerated, self).__init__(**kwargs) - self.granularity = granularity - self.configuration = configuration - self.aggregation = aggregation - self.grouping = grouping - self.filter = filter - - class QueryDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the query. - :param columns: Array of column names to be included in the query. Any valid query column name + :ivar columns: Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. - :type columns: list[str] + :vartype columns: list[str] """ _attribute_map = { @@ -1603,6 +2383,11 @@ def __init__( columns: Optional[List[str]] = None, **kwargs ): + """ + :keyword columns: Array of column names to be included in the query. Any valid query column + name is allowed. If not provided, then query includes all columns. + :paramtype columns: list[str] + """ super(QueryDatasetConfiguration, self).__init__(**kwargs) self.columns = columns @@ -1612,17 +2397,17 @@ class QueryDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. The type of the query. Possible values include: "Usage", "ActualCost", + :ivar type: Required. The type of the query. Possible values include: "Usage", "ActualCost", "AmortizedCost". - :type type: str or ~azure.mgmt.costmanagement.models.ExportType - :param timeframe: Required. The time frame for pulling data for the query. If custom, then a + :vartype type: str or ~azure.mgmt.costmanagement.models.ExportType + :ivar timeframe: Required. The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: "MonthToDate", "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType - :param time_period: Has time period for pulling data for the query. - :type time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod - :param dataset: Required. Has definition for data in this query. - :type dataset: ~azure.mgmt.costmanagement.models.QueryDataset + :vartype timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :ivar time_period: Has time period for pulling data for the query. + :vartype time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :ivar dataset: Required. Has definition for data in this query. + :vartype dataset: ~azure.mgmt.costmanagement.models.QueryDataset """ _validation = { @@ -1647,6 +2432,19 @@ def __init__( time_period: Optional["QueryTimePeriod"] = None, **kwargs ): + """ + :keyword type: Required. The type of the query. Possible values include: "Usage", "ActualCost", + "AmortizedCost". + :paramtype type: str or ~azure.mgmt.costmanagement.models.ExportType + :keyword timeframe: Required. The time frame for pulling data for the query. If custom, then a + specific time period must be provided. Possible values include: "MonthToDate", + "BillingMonthToDate", "TheLastMonth", "TheLastBillingMonth", "WeekToDate", "Custom". + :paramtype timeframe: str or ~azure.mgmt.costmanagement.models.TimeframeType + :keyword time_period: Has time period for pulling data for the query. + :paramtype time_period: ~azure.mgmt.costmanagement.models.QueryTimePeriod + :keyword dataset: Required. Has definition for data in this query. + :paramtype dataset: ~azure.mgmt.costmanagement.models.QueryDataset + """ super(QueryDefinition, self).__init__(**kwargs) self.type = type self.timeframe = timeframe @@ -1657,14 +2455,14 @@ def __init__( class QueryFilter(msrest.serialization.Model): """The filter expression to be used in the export. - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :ivar and_property: The logical "AND" expression. Must have at least 2 items. + :vartype and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :ivar or_property: The logical "OR" expression. Must have at least 2 items. + :vartype or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :ivar dimensions: Has comparison expression for a dimension. + :vartype dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :ivar tags: A set of tags. Has comparison expression for a tag. + :vartype tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression """ _validation = { @@ -1688,6 +2486,16 @@ def __init__( tags: Optional["QueryComparisonExpression"] = None, **kwargs ): + """ + :keyword and_property: The logical "AND" expression. Must have at least 2 items. + :paramtype and_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :keyword or_property: The logical "OR" expression. Must have at least 2 items. + :paramtype or_property: list[~azure.mgmt.costmanagement.models.QueryFilter] + :keyword dimensions: Has comparison expression for a dimension. + :paramtype dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + :keyword tags: A set of tags. Has comparison expression for a tag. + :paramtype tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression + """ super(QueryFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property @@ -1695,57 +2503,16 @@ def __init__( self.tags = tags -class QueryFilterAutoGenerated(msrest.serialization.Model): - """The filter expression to be used in the export. - - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.QueryFilterAutoGenerated] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.QueryComparisonExpression - """ - - _validation = { - 'and_property': {'min_items': 2}, - 'or_property': {'min_items': 2}, - } - - _attribute_map = { - 'and_property': {'key': 'and', 'type': '[QueryFilterAutoGenerated]'}, - 'or_property': {'key': 'or', 'type': '[QueryFilterAutoGenerated]'}, - 'dimensions': {'key': 'dimensions', 'type': 'QueryComparisonExpression'}, - 'tags': {'key': 'tags', 'type': 'QueryComparisonExpression'}, - } - - def __init__( - self, - *, - and_property: Optional[List["QueryFilterAutoGenerated"]] = None, - or_property: Optional[List["QueryFilterAutoGenerated"]] = None, - dimensions: Optional["QueryComparisonExpression"] = None, - tags: Optional["QueryComparisonExpression"] = None, - **kwargs - ): - super(QueryFilterAutoGenerated, self).__init__(**kwargs) - self.and_property = and_property - self.or_property = or_property - self.dimensions = dimensions - self.tags = tags - - class QueryGrouping(msrest.serialization.Model): """The group by expression to be used in the query. All required parameters must be populated in order to send to Azure. - :param type: Required. Has type of the column to group. Possible values include: "Tag", + :ivar type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.QueryColumnType - :param name: Required. The name of the column to group. - :type name: str + :vartype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :ivar name: Required. The name of the column to group. + :vartype name: str """ _validation = { @@ -1765,6 +2532,13 @@ def __init__( name: str, **kwargs ): + """ + :keyword type: Required. Has type of the column to group. Possible values include: "Tag", + "Dimension". + :paramtype type: str or ~azure.mgmt.costmanagement.models.QueryColumnType + :keyword name: Required. The name of the column to group. + :paramtype name: str + """ super(QueryGrouping, self).__init__(**kwargs) self.type = type self.name = name @@ -1781,40 +2555,40 @@ class QueryResult(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be - used to determine whether the user is updating the latest version or not. - :type e_tag: str - :ivar location: Resource location. + :ivar location: Location of the resource. :vartype location: str - :ivar sku: Resource SKU. + :ivar sku: SKU of the resource. :vartype sku: str - :param next_link: The link (url) to the next page of results. - :type next_link: str - :param columns: Array of columns. - :type columns: list[~azure.mgmt.costmanagement.models.QueryColumn] - :param rows: Array of rows. - :type rows: list[list[any]] + :ivar e_tag: ETag of the resource. + :vartype e_tag: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + :ivar columns: Array of columns. + :vartype columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :ivar rows: Array of rows. + :vartype rows: list[list[any]] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'tags': {'readonly': True}, 'location': {'readonly': True}, 'sku': {'readonly': True}, + 'e_tag': {'readonly': True}, + 'tags': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, 'columns': {'key': 'properties.columns', 'type': '[QueryColumn]'}, 'rows': {'key': 'properties.rows', 'type': '[[object]]'}, @@ -1823,16 +2597,20 @@ class QueryResult(Resource): def __init__( self, *, - e_tag: Optional[str] = None, next_link: Optional[str] = None, columns: Optional[List["QueryColumn"]] = None, rows: Optional[List[List[Any]]] = None, **kwargs ): + """ + :keyword next_link: The link (url) to the next page of results. + :paramtype next_link: str + :keyword columns: Array of columns. + :paramtype columns: list[~azure.mgmt.costmanagement.models.QueryColumn] + :keyword rows: Array of rows. + :paramtype rows: list[list[any]] + """ super(QueryResult, self).__init__(**kwargs) - self.e_tag = e_tag - self.location = None - self.sku = None self.next_link = next_link self.columns = columns self.rows = rows @@ -1843,10 +2621,10 @@ class QueryTimePeriod(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param from_property: Required. The start date to pull data from. - :type from_property: ~datetime.datetime - :param to: Required. The end date to pull data to. - :type to: ~datetime.datetime + :ivar from_property: Required. The start date to pull data from. + :vartype from_property: ~datetime.datetime + :ivar to: Required. The end date to pull data to. + :vartype to: ~datetime.datetime """ _validation = { @@ -1866,6 +2644,12 @@ def __init__( to: datetime.datetime, **kwargs ): + """ + :keyword from_property: Required. The start date to pull data from. + :paramtype from_property: ~datetime.datetime + :keyword to: Required. The end date to pull data to. + :paramtype to: ~datetime.datetime + """ super(QueryTimePeriod, self).__init__(**kwargs) self.from_property = from_property self.to = to @@ -1876,11 +2660,11 @@ class ReportConfigAggregation(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to aggregate. - :type name: str - :param function: Required. The name of the aggregation function to use. Possible values - include: "Avg", "Max", "Min", "Sum". - :type function: str or ~azure.mgmt.costmanagement.models.FunctionType + :ivar name: Required. The name of the column to aggregate. + :vartype name: str + :ivar function: Required. The name of the aggregation function to use. Possible values include: + "Sum". + :vartype function: str or ~azure.mgmt.costmanagement.models.FunctionType """ _validation = { @@ -1900,6 +2684,13 @@ def __init__( function: Union[str, "FunctionType"], **kwargs ): + """ + :keyword name: Required. The name of the column to aggregate. + :paramtype name: str + :keyword function: Required. The name of the aggregation function to use. Possible values + include: "Sum". + :paramtype function: str or ~azure.mgmt.costmanagement.models.FunctionType + """ super(ReportConfigAggregation, self).__init__(**kwargs) self.name = name self.function = function @@ -1910,13 +2701,13 @@ class ReportConfigComparisonExpression(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the column to use in comparison. - :type name: str - :param operator: Required. The operator to use for comparison. Possible values include: "In", + :ivar name: Required. The name of the column to use in comparison. + :vartype name: str + :ivar operator: Required. The operator to use for comparison. Possible values include: "In", "Contains". - :type operator: str or ~azure.mgmt.costmanagement.models.OperatorType - :param values: Required. Array of values to use for comparison. - :type values: list[str] + :vartype operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :ivar values: Required. Array of values to use for comparison. + :vartype values: list[str] """ _validation = { @@ -1939,6 +2730,15 @@ def __init__( values: List[str], **kwargs ): + """ + :keyword name: Required. The name of the column to use in comparison. + :paramtype name: str + :keyword operator: Required. The operator to use for comparison. Possible values include: "In", + "Contains". + :paramtype operator: str or ~azure.mgmt.costmanagement.models.OperatorType + :keyword values: Required. Array of values to use for comparison. + :paramtype values: list[str] + """ super(ReportConfigComparisonExpression, self).__init__(**kwargs) self.name = name self.operator = operator @@ -1948,23 +2748,23 @@ def __init__( class ReportConfigDataset(msrest.serialization.Model): """The definition of data present in the report. - :param granularity: The granularity of rows in the report. Possible values include: "Daily", + :ivar granularity: The granularity of rows in the report. Possible values include: "Daily", "Monthly". - :type granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType - :param configuration: Has configuration information for the data in the report. The + :vartype granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :ivar configuration: Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided. - :type configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration - :param aggregation: Dictionary of aggregation expression to use in the report. The key of each + :vartype configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :ivar aggregation: Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses. - :type aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] - :param grouping: Array of group by expression to use in the report. Report can have up to 2 + :vartype aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :ivar grouping: Array of group by expression to use in the report. Report can have up to 2 group by clauses. - :type grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] - :param sorting: Array of order by expression to use in the report. - :type sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] - :param filter: Has filter expression to use in the report. - :type filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + :vartype grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :ivar sorting: Array of order by expression to use in the report. + :vartype sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] + :ivar filter: Has filter expression to use in the report. + :vartype filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter """ _validation = { @@ -1991,6 +2791,25 @@ def __init__( filter: Optional["ReportConfigFilter"] = None, **kwargs ): + """ + :keyword granularity: The granularity of rows in the report. Possible values include: "Daily", + "Monthly". + :paramtype granularity: str or ~azure.mgmt.costmanagement.models.ReportGranularityType + :keyword configuration: Has configuration information for the data in the report. The + configuration will be ignored if aggregation and grouping are provided. + :paramtype configuration: ~azure.mgmt.costmanagement.models.ReportConfigDatasetConfiguration + :keyword aggregation: Dictionary of aggregation expression to use in the report. The key of + each item in the dictionary is the alias for the aggregated column. Report can have up to 2 + aggregation clauses. + :paramtype aggregation: dict[str, ~azure.mgmt.costmanagement.models.ReportConfigAggregation] + :keyword grouping: Array of group by expression to use in the report. Report can have up to 2 + group by clauses. + :paramtype grouping: list[~azure.mgmt.costmanagement.models.ReportConfigGrouping] + :keyword sorting: Array of order by expression to use in the report. + :paramtype sorting: list[~azure.mgmt.costmanagement.models.ReportConfigSorting] + :keyword filter: Has filter expression to use in the report. + :paramtype filter: ~azure.mgmt.costmanagement.models.ReportConfigFilter + """ super(ReportConfigDataset, self).__init__(**kwargs) self.granularity = granularity self.configuration = configuration @@ -2003,9 +2822,9 @@ def __init__( class ReportConfigDatasetConfiguration(msrest.serialization.Model): """The configuration of dataset in the report. - :param columns: Array of column names to be included in the report. Any valid report column - name is allowed. If not provided, then report includes all columns. - :type columns: list[str] + :ivar columns: Array of column names to be included in the report. Any valid report column name + is allowed. If not provided, then report includes all columns. + :vartype columns: list[str] """ _attribute_map = { @@ -2018,6 +2837,11 @@ def __init__( columns: Optional[List[str]] = None, **kwargs ): + """ + :keyword columns: Array of column names to be included in the report. Any valid report column + name is allowed. If not provided, then report includes all columns. + :paramtype columns: list[str] + """ super(ReportConfigDatasetConfiguration, self).__init__(**kwargs) self.columns = columns @@ -2025,18 +2849,14 @@ def __init__( class ReportConfigFilter(msrest.serialization.Model): """The filter expression to be used in the report. - :param and_property: The logical "AND" expression. Must have at least 2 items. - :type and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param or_property: The logical "OR" expression. Must have at least 2 items. - :type or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] - :param dimensions: Has comparison expression for a dimension. - :type dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tags: A set of tags. Has comparison expression for a tag. - :type tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_key: Has comparison expression for a tag key. - :type tag_key: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression - :param tag_value: Has comparison expression for a tag value. - :type tag_value: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :ivar and_property: The logical "AND" expression. Must have at least 2 items. + :vartype and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :ivar or_property: The logical "OR" expression. Must have at least 2 items. + :vartype or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :ivar dimensions: Has comparison expression for a dimension. + :vartype dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :ivar tags: A set of tags. Has comparison expression for a tag. + :vartype tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression """ _validation = { @@ -2049,8 +2869,6 @@ class ReportConfigFilter(msrest.serialization.Model): 'or_property': {'key': 'or', 'type': '[ReportConfigFilter]'}, 'dimensions': {'key': 'dimensions', 'type': 'ReportConfigComparisonExpression'}, 'tags': {'key': 'tags', 'type': 'ReportConfigComparisonExpression'}, - 'tag_key': {'key': 'tagKey', 'type': 'ReportConfigComparisonExpression'}, - 'tag_value': {'key': 'tagValue', 'type': 'ReportConfigComparisonExpression'}, } def __init__( @@ -2060,17 +2878,23 @@ def __init__( or_property: Optional[List["ReportConfigFilter"]] = None, dimensions: Optional["ReportConfigComparisonExpression"] = None, tags: Optional["ReportConfigComparisonExpression"] = None, - tag_key: Optional["ReportConfigComparisonExpression"] = None, - tag_value: Optional["ReportConfigComparisonExpression"] = None, **kwargs ): + """ + :keyword and_property: The logical "AND" expression. Must have at least 2 items. + :paramtype and_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :keyword or_property: The logical "OR" expression. Must have at least 2 items. + :paramtype or_property: list[~azure.mgmt.costmanagement.models.ReportConfigFilter] + :keyword dimensions: Has comparison expression for a dimension. + :paramtype dimensions: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + :keyword tags: A set of tags. Has comparison expression for a tag. + :paramtype tags: ~azure.mgmt.costmanagement.models.ReportConfigComparisonExpression + """ super(ReportConfigFilter, self).__init__(**kwargs) self.and_property = and_property self.or_property = or_property self.dimensions = dimensions self.tags = tags - self.tag_key = tag_key - self.tag_value = tag_value class ReportConfigGrouping(msrest.serialization.Model): @@ -2078,12 +2902,12 @@ class ReportConfigGrouping(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. Has type of the column to group. Possible values include: "Tag", + :ivar type: Required. Has type of the column to group. Possible values include: "Tag", "Dimension". - :type type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType - :param name: Required. The name of the column to group. This version supports subscription + :vartype type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :ivar name: Required. The name of the column to group. This version supports subscription lowest possible grain. - :type name: str + :vartype name: str """ _validation = { @@ -2103,6 +2927,14 @@ def __init__( name: str, **kwargs ): + """ + :keyword type: Required. Has type of the column to group. Possible values include: "Tag", + "Dimension". + :paramtype type: str or ~azure.mgmt.costmanagement.models.ReportConfigColumnType + :keyword name: Required. The name of the column to group. This version supports subscription + lowest possible grain. + :paramtype name: str + """ super(ReportConfigGrouping, self).__init__(**kwargs) self.type = type self.name = name @@ -2113,10 +2945,10 @@ class ReportConfigSorting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param direction: Direction of sort. Possible values include: "Ascending", "Descending". - :type direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingDirection - :param name: Required. The name of the column to sort. - :type name: str + :ivar direction: Direction of sort. Possible values include: "Ascending", "Descending". + :vartype direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingType + :ivar name: Required. The name of the column to sort. + :vartype name: str """ _validation = { @@ -2132,9 +2964,15 @@ def __init__( self, *, name: str, - direction: Optional[Union[str, "ReportConfigSortingDirection"]] = None, + direction: Optional[Union[str, "ReportConfigSortingType"]] = None, **kwargs ): + """ + :keyword direction: Direction of sort. Possible values include: "Ascending", "Descending". + :paramtype direction: str or ~azure.mgmt.costmanagement.models.ReportConfigSortingType + :keyword name: Required. The name of the column to sort. + :paramtype name: str + """ super(ReportConfigSorting, self).__init__(**kwargs) self.direction = direction self.name = name @@ -2145,10 +2983,10 @@ class ReportConfigTimePeriod(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param from_property: Required. The start date to pull data from. - :type from_property: ~datetime.datetime - :param to: Required. The end date to pull data to. - :type to: ~datetime.datetime + :ivar from_property: Required. The start date to pull data from. + :vartype from_property: ~datetime.datetime + :ivar to: Required. The end date to pull data to. + :vartype to: ~datetime.datetime """ _validation = { @@ -2168,102 +3006,23 @@ def __init__( to: datetime.datetime, **kwargs ): + """ + :keyword from_property: Required. The start date to pull data from. + :paramtype from_property: ~datetime.datetime + :keyword to: Required. The end date to pull data to. + :paramtype to: ~datetime.datetime + """ super(ReportConfigTimePeriod, self).__init__(**kwargs) self.from_property = from_property self.to = to -class Setting(ProxySettingResource): - """State of the myscope setting. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar kind: Resource kind. - :vartype kind: str - :ivar type: Resource type. - :vartype type: str - :param scope: Sets the default scope the current user will see when they sign into Azure Cost - Management in the Azure portal. - :type scope: str - :param start_on: Indicates what scope Cost Management in the Azure portal should default to. - Allowed values: LastUsed. Possible values include: "LastUsed", "ScopePicker", "SpecificScope". - :type start_on: str or ~azure.mgmt.costmanagement.models.SettingsPropertiesStartOn - :param cache: Array of scopes with additional details used by Cost Management in the Azure - portal. - :type cache: list[~azure.mgmt.costmanagement.models.CacheItem] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'kind': {'readonly': True, 'max_length': 10, 'min_length': 0}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'start_on': {'key': 'properties.startOn', 'type': 'str'}, - 'cache': {'key': 'properties.cache', 'type': '[CacheItem]'}, - } - - def __init__( - self, - *, - scope: Optional[str] = None, - start_on: Optional[Union[str, "SettingsPropertiesStartOn"]] = None, - cache: Optional[List["CacheItem"]] = None, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.scope = scope - self.start_on = start_on - self.cache = cache - - -class SettingsListResult(msrest.serialization.Model): - """Result of listing settings. It contains a list of available settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of settings. - :vartype value: list[~azure.mgmt.costmanagement.models.Setting] - :ivar next_link: The link (url) to the next page of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True, 'max_items': 10, 'min_items': 0}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Setting]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SettingsListResult, self).__init__(**kwargs) - self.value = None - self.next_link = None - - class Status(msrest.serialization.Model): """The status of the long running operation. - :param status: The status of the long running operation. Possible values include: "Running", - "Completed", "Failed". - :type status: str or ~azure.mgmt.costmanagement.models.OperationStatusType + :ivar status: The status of the long running operation. Possible values include: "InProgress", + "Completed", "Failed", "Queued", "NoDataFound", "ReadyToDownload", "TimedOut". + :vartype status: str or ~azure.mgmt.costmanagement.models.ReportOperationStatusType """ _attribute_map = { @@ -2273,9 +3032,14 @@ class Status(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "OperationStatusType"]] = None, + status: Optional[Union[str, "ReportOperationStatusType"]] = None, **kwargs ): + """ + :keyword status: The status of the long running operation. Possible values include: + "InProgress", "Completed", "Failed", "Queued", "NoDataFound", "ReadyToDownload", "TimedOut". + :paramtype status: str or ~azure.mgmt.costmanagement.models.ReportOperationStatusType + """ super(Status, self).__init__(**kwargs) self.status = status @@ -2291,12 +3055,12 @@ class View(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + :ivar e_tag: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - :type e_tag: str - :param display_name: User input name of the view. Required. - :type display_name: str - :param scope: Cost Management scope to save the view on. This includes + :vartype e_tag: str + :ivar display_name: User input name of the view. Required. + :vartype display_name: str + :ivar scope: Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, @@ -2313,41 +3077,41 @@ class View(ProxyResource): ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. - :type scope: str + :vartype scope: str :ivar created_on: Date the user created this view. :vartype created_on: ~datetime.datetime :ivar modified_on: Date when the user last modified this view. :vartype modified_on: ~datetime.datetime - :ivar date_range: Selected date range for viewing cost in. + :ivar date_range: Date range of the current view. :vartype date_range: str - :ivar currency: Selected currency. + :ivar currency: Currency of the current view. :vartype currency: str - :param chart: Chart type of the main view in Cost Analysis. Required. Possible values include: + :ivar chart: Chart type of the main view in Cost Analysis. Required. Possible values include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". - :type chart: str or ~azure.mgmt.costmanagement.models.ChartType - :param accumulated: Show costs accumulated over time. Possible values include: "true", "false". - :type accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType - :param metric: Metric to use when displaying costs. Possible values include: "ActualCost", + :vartype chart: str or ~azure.mgmt.costmanagement.models.ChartType + :ivar accumulated: Show costs accumulated over time. Possible values include: "true", "false". + :vartype accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :ivar metric: Metric to use when displaying costs. Possible values include: "ActualCost", "AmortizedCost", "AHUB". - :type metric: str or ~azure.mgmt.costmanagement.models.MetricType - :param kpis: List of KPIs to show in Cost Analysis UI. - :type kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] - :param pivots: Configuration of 3 sub-views in the Cost Analysis UI. - :type pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] - :param type_properties_query_type: The type of the report. Usage represents actual usage, + :vartype metric: str or ~azure.mgmt.costmanagement.models.MetricType + :ivar kpis: List of KPIs to show in Cost Analysis UI. + :vartype kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :ivar pivots: Configuration of 3 sub-views in the Cost Analysis UI. + :vartype pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :ivar type_properties_query_type: The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates. Possible values include: "Usage". - :type type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType - :param timeframe: The time frame for pulling data for the report. If custom, then a specific + :vartype type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType + :ivar timeframe: The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible values include: "WeekToDate", "MonthToDate", "YearToDate", "Custom". - :type timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType - :param time_period: Has time period for pulling data for the report. - :type time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod - :param data_set: Has definition for data in this report config. - :type data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset - :ivar include_monetary_commitment: Include monetary commitment. + :vartype timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :ivar time_period: Has time period for pulling data for the report. + :vartype time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :ivar data_set: Has definition for data in this report config. + :vartype data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :ivar include_monetary_commitment: If true, report includes monetary commitment. :vartype include_monetary_commitment: bool """ @@ -2359,7 +3123,6 @@ class View(ProxyResource): 'modified_on': {'readonly': True}, 'date_range': {'readonly': True}, 'currency': {'readonly': True}, - 'include_monetary_commitment': {'readonly': True}, } _attribute_map = { @@ -2400,8 +3163,62 @@ def __init__( timeframe: Optional[Union[str, "ReportTimeframeType"]] = None, time_period: Optional["ReportConfigTimePeriod"] = None, data_set: Optional["ReportConfigDataset"] = None, + include_monetary_commitment: Optional[bool] = None, **kwargs ): + """ + :keyword e_tag: eTag of the resource. To handle concurrent update scenario, this field will be + used to determine whether the user is updating the latest version or not. + :paramtype e_tag: str + :keyword display_name: User input name of the view. Required. + :paramtype display_name: str + :keyword scope: Cost Management scope to save the view on. This includes + 'subscriptions/{subscriptionId}' for subscription scope, + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + Department scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + for EnrollmentAccount scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for BillingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' + for Management Group scope, + '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for + ExternalBillingAccount scope, and + '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for + ExternalSubscription scope. + :paramtype scope: str + :keyword chart: Chart type of the main view in Cost Analysis. Required. Possible values + include: "Area", "Line", "StackedColumn", "GroupedColumn", "Table". + :paramtype chart: str or ~azure.mgmt.costmanagement.models.ChartType + :keyword accumulated: Show costs accumulated over time. Possible values include: "true", + "false". + :paramtype accumulated: str or ~azure.mgmt.costmanagement.models.AccumulatedType + :keyword metric: Metric to use when displaying costs. Possible values include: "ActualCost", + "AmortizedCost", "AHUB". + :paramtype metric: str or ~azure.mgmt.costmanagement.models.MetricType + :keyword kpis: List of KPIs to show in Cost Analysis UI. + :paramtype kpis: list[~azure.mgmt.costmanagement.models.KpiProperties] + :keyword pivots: Configuration of 3 sub-views in the Cost Analysis UI. + :paramtype pivots: list[~azure.mgmt.costmanagement.models.PivotProperties] + :keyword type_properties_query_type: The type of the report. Usage represents actual usage, + forecast represents forecasted data and UsageAndForecast represents both usage and forecasted + data. Actual usage and forecasted data can be differentiated based on dates. Possible values + include: "Usage". + :paramtype type_properties_query_type: str or ~azure.mgmt.costmanagement.models.ReportType + :keyword timeframe: The time frame for pulling data for the report. If custom, then a specific + time period must be provided. Possible values include: "WeekToDate", "MonthToDate", + "YearToDate", "Custom". + :paramtype timeframe: str or ~azure.mgmt.costmanagement.models.ReportTimeframeType + :keyword time_period: Has time period for pulling data for the report. + :paramtype time_period: ~azure.mgmt.costmanagement.models.ReportConfigTimePeriod + :keyword data_set: Has definition for data in this report config. + :paramtype data_set: ~azure.mgmt.costmanagement.models.ReportConfigDataset + :keyword include_monetary_commitment: If true, report includes monetary commitment. + :paramtype include_monetary_commitment: bool + """ super(View, self).__init__(e_tag=e_tag, **kwargs) self.display_name = display_name self.scope = scope @@ -2418,7 +3235,7 @@ def __init__( self.timeframe = timeframe self.time_period = time_period self.data_set = data_set - self.include_monetary_commitment = None + self.include_monetary_commitment = include_monetary_commitment class ViewListResult(msrest.serialization.Model): @@ -2446,6 +3263,8 @@ def __init__( self, **kwargs ): + """ + """ super(ViewListResult, self).__init__(**kwargs) self.value = None self.next_link = None diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py index c70a4cb564cb..7f864e537b31 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/__init__.py @@ -6,7 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._settings_operations import SettingsOperations +from ._exports_operations import ExportsOperations +from ._generate_detailed_cost_report_operations import GenerateDetailedCostReportOperations +from ._generate_detailed_cost_report_operation_results_operations import GenerateDetailedCostReportOperationResultsOperations +from ._generate_detailed_cost_report_operation_status_operations import GenerateDetailedCostReportOperationStatusOperations from ._views_operations import ViewsOperations from ._alerts_operations import AlertsOperations from ._forecast_operations import ForecastOperations @@ -14,10 +17,12 @@ from ._query_operations import QueryOperations from ._generate_reservation_details_report_operations import GenerateReservationDetailsReportOperations from ._operations import Operations -from ._exports_operations import ExportsOperations __all__ = [ - 'SettingsOperations', + 'ExportsOperations', + 'GenerateDetailedCostReportOperations', + 'GenerateDetailedCostReportOperationResultsOperations', + 'GenerateDetailedCostReportOperationStatusOperations', 'ViewsOperations', 'AlertsOperations', 'ForecastOperations', @@ -25,5 +30,4 @@ 'QueryOperations', 'GenerateReservationDetailsReportOperations', 'Operations', - 'ExportsOperations', ] diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py index 13969e75db88..6b992d89d9cd 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_alerts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,166 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + scope: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/alerts") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + scope: str, + alert_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "alertId": _SERIALIZER.url("alert_id", alert_id, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_dismiss_request( + scope: str, + alert_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "alertId": _SERIALIZER.url("alert_id", alert_id, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_external_request( + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts") # pylint: disable=line-too-long + path_format_arguments = { + "externalCloudProviderType": _SERIALIZER.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), + "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class AlertsOperations(object): """AlertsOperations operations. @@ -44,12 +189,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - scope, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AlertsResult" + scope: str, + **kwargs: Any + ) -> "_models.AlertsResult": """Lists the alerts for scope defined. :param scope: The scope associated with alerts operations. This includes @@ -79,31 +224,28 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_request( + scope=scope, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsResult', pipeline_response) @@ -112,15 +254,17 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts"} # type: ignore + + + @distributed_trace def get( self, - scope, # type: str - alert_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Alert" + scope: str, + alert_id: str, + **kwargs: Any + ) -> "_models.Alert": """Gets the alert for the scope by alert ID. :param scope: The scope associated with alerts operations. This includes @@ -152,32 +296,29 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + scope=scope, + alert_id=alert_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -186,16 +327,18 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + + + @distributed_trace def dismiss( self, - scope, # type: str - alert_id, # type: str - parameters, # type: "_models.DismissAlertPayload" - **kwargs # type: Any - ): - # type: (...) -> "_models.Alert" + scope: str, + alert_id: str, + parameters: "_models.DismissAlertPayload", + **kwargs: Any + ) -> "_models.Alert": """Dismisses the specified alert. :param scope: The scope associated with alerts operations. This includes @@ -229,37 +372,33 @@ def dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.dismiss.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'alertId': self._serialize.url("alert_id", alert_id, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'DismissAlertPayload') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DismissAlertPayload') + + request = build_dismiss_request( + scope=scope, + alert_id=alert_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.dismiss.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -268,21 +407,24 @@ def dismiss( return cls(pipeline_response, deserialized, {}) return deserialized - dismiss.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}'} # type: ignore + dismiss.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}"} # type: ignore + + + @distributed_trace def list_external( self, - external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"] - external_cloud_provider_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.AlertsResult" + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + **kwargs: Any + ) -> "_models.AlertsResult": """Lists the Alerts for external cloud provider type defined. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -296,32 +438,29 @@ def list_external( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list_external.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_external_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + template_url=self.list_external.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsResult', pipeline_response) @@ -330,4 +469,6 @@ def list_external( return cls(pipeline_response, deserialized, {}) return deserialized - list_external.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts'} # type: ignore + + list_external.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py index ff843ebbf69e..25fcbe738865 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_dimensions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,23 +6,116 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + scope: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/dimensions") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + if skiptoken is not None: + _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') + if top is not None: + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=1000, minimum=1) + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_by_external_cloud_provider_type_request( + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + *, + filter: Optional[str] = None, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions") # pylint: disable=line-too-long + path_format_arguments = { + "externalCloudProviderType": _SERIALIZER.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), + "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + if skiptoken is not None: + _query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') + if top is not None: + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', maximum=1000, minimum=1) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class DimensionsOperations(object): """DimensionsOperations operations. @@ -45,16 +139,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - scope, # type: str - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skiptoken=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DimensionsListResult"] + scope: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.DimensionsListResult"]: """Lists the dimensions by the defined scope. :param scope: The scope associated with dimension operations. This includes @@ -75,63 +169,66 @@ def list( specific for partners. :type scope: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, - properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. Default value is + None. :type filter: str :param expand: May be used to expand the properties/data within a dimension category. By - default, data is not included when listing dimensions. + default, data is not included when listing dimensions. Default value is None. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include - a skiptoken parameter that specifies a starting point to use for subsequent calls. + a skiptoken parameter that specifies a starting point to use for subsequent calls. Default + value is None. :type skiptoken: str :param top: May be used to limit the number of results to the most recent N dimension data. + Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DimensionsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResultor None] + :return: An iterator like instance of either DimensionsListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + scope=scope, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + scope=scope, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('DimensionsListResult', pipeline_response) + deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -140,100 +237,110 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/dimensions'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/dimensions"} # type: ignore + @distributed_trace def by_external_cloud_provider_type( self, - external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"] - external_cloud_provider_id, # type: str - filter=None, # type: Optional[str] - expand=None, # type: Optional[str] - skiptoken=None, # type: Optional[str] - top=None, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.DimensionsListResult"] + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + filter: Optional[str] = None, + expand: Optional[str] = None, + skiptoken: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.DimensionsListResult"]: """Lists the dimensions by the external cloud provider type. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str :param filter: May be used to filter dimensions by properties/category, properties/usageStart, - properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'. Default value is + None. :type filter: str :param expand: May be used to expand the properties/data within a dimension category. By - default, data is not included when listing dimensions. + default, data is not included when listing dimensions. Default value is None. :type expand: str :param skiptoken: Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include - a skiptoken parameter that specifies a starting point to use for subsequent calls. + a skiptoken parameter that specifies a starting point to use for subsequent calls. Default + value is None. :type skiptoken: str :param top: May be used to limit the number of results to the most recent N dimension data. + Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DimensionsListResult or the result of cls(response) + :return: An iterator like instance of either DimensionsListResult or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.DimensionsListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DimensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.by_external_cloud_provider_type.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=self.by_external_cloud_provider_type.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + filter=filter, + expand=expand, + skiptoken=skiptoken, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('DimensionsListResult', pipeline_response) + deserialized = self._deserialize("DimensionsListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -242,17 +349,22 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) - by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions'} # type: ignore + by_external_cloud_provider_type.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py index 89eefe5166d4..824cebc6932d 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_exports_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,242 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + scope: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + scope: str, + export_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "exportName": _SERIALIZER.url("export_name", export_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if expand is not None: + _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + scope: str, + export_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "exportName": _SERIALIZER.url("export_name", export_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + scope: str, + export_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "exportName": _SERIALIZER.url("export_name", export_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_execute_request( + scope: str, + export_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "exportName": _SERIALIZER.url("export_name", export_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_execution_history_request( + scope: str, + export_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + "exportName": _SERIALIZER.url("export_name", export_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class ExportsOperations(object): """ExportsOperations operations. @@ -44,15 +265,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - scope, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExportListResult" + scope: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.ExportListResult": """The operation to list all exports at the given scope. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -69,6 +291,10 @@ def list( '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. :type scope: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last execution of each export. + Default value is None. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ExportListResult, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.ExportListResult @@ -79,31 +305,29 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_list_request( + scope=scope, + api_version=api_version, + expand=expand, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExportListResult', pipeline_response) @@ -112,18 +336,21 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports'} # type: ignore + list.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports"} # type: ignore + + + @distributed_trace def get( self, - scope, # type: str - export_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Export" + scope: str, + export_name: str, + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.Export": """The operation to get the export for the defined scope by export name. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -142,6 +369,10 @@ def get( :type scope: str :param export_name: Export Name. :type export_name: str + :param expand: May be used to expand the properties within an export. Currently only + 'runHistory' is supported and will return information for the last 10 executions of the export. + Default value is None. + :type expand: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Export, or the result of cls(response) :rtype: ~azure.mgmt.costmanagement.models.Export @@ -152,32 +383,30 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + scope=scope, + export_name=export_name, + api_version=api_version, + expand=expand, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Export', pipeline_response) @@ -186,21 +415,23 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + + + @distributed_trace def create_or_update( self, - scope, # type: str - export_name, # type: str - parameters, # type: "_models.Export" - **kwargs # type: Any - ): - # type: (...) -> "_models.Export" + scope: str, + export_name: str, + parameters: "_models.Export", + **kwargs: Any + ) -> "_models.Export": """The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -231,37 +462,33 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Export') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Export') + + request = build_create_or_update_request( + scope=scope, + export_name=export_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -274,18 +501,20 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore - def delete( + create_or_update.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - scope, # type: str - export_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + scope: str, + export_name: str, + **kwargs: Any + ) -> None: """The operation to delete a export. - :param scope: The scope associated with query and export operations. This includes + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -314,49 +543,47 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_delete_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}'} # type: ignore + delete.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}"} # type: ignore - def execute( + + @distributed_trace + def execute( # pylint: disable=inconsistent-return-statements self, - scope, # type: str - export_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """The operation to execute a export. - - :param scope: The scope associated with query and export operations. This includes + scope: str, + export_name: str, + **kwargs: Any + ) -> None: + """The operation to execute an export. + + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -385,49 +612,47 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.execute.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_execute_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.execute.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - execute.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run'} # type: ignore + execute.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run"} # type: ignore + + @distributed_trace def get_execution_history( self, - scope, # type: str - export_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExportExecutionListResult" - """The operation to get the execution history of an export for the defined scope by export name. - - :param scope: The scope associated with query and export operations. This includes + scope: str, + export_name: str, + **kwargs: Any + ) -> "_models.ExportExecutionListResult": + """The operation to get the execution history of an export for the defined scope and export name. + + :param scope: The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and @@ -456,32 +681,29 @@ def get_execution_history( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_execution_history.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - 'exportName': self._serialize.url("export_name", export_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_execution_history_request( + scope=scope, + export_name=export_name, + api_version=api_version, + template_url=self.get_execution_history.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExportExecutionListResult', pipeline_response) @@ -490,4 +712,6 @@ def get_execution_history( return cls(pipeline_response, deserialized, {}) return deserialized - get_execution_history.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory'} # type: ignore + + get_execution_history.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py index 71c2e338e1e5..f6716ff3727c 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,112 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_usage_request( + scope: str, + *, + json: JSONType = None, + content: Any = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/forecast") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if filter is not None: + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +def build_external_cloud_provider_usage_request( + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + *, + json: JSONType = None, + content: Any = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast") # pylint: disable=line-too-long + path_format_arguments = { + "externalCloudProviderType": _SERIALIZER.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), + "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if filter is not None: + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) class ForecastOperations(object): """ForecastOperations operations. @@ -44,14 +135,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def usage( self, - scope, # type: str - parameters, # type: "_models.ForecastDefinition" - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.QueryResult"] + scope: str, + parameters: "_models.ForecastDefinition", + filter: Optional[str] = None, + **kwargs: Any + ) -> Optional["_models.QueryResult"]: """Lists the forecast charges for scope defined. :param scope: The scope associated with forecast operations. This includes @@ -75,7 +166,7 @@ def usage( :type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', - and 'and'. It does not currently support 'ne', 'or', or 'not'. + and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) @@ -87,38 +178,33 @@ def usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ForecastDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ForecastDefinition') + + request = build_usage_request( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + filter=filter, + template_url=self.usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -129,23 +215,26 @@ def usage( return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/forecast'} # type: ignore + usage.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/forecast"} # type: ignore + + + @distributed_trace def external_cloud_provider_usage( self, - external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"] - external_cloud_provider_id, # type: str - parameters, # type: "_models.ForecastDefinition" - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.QueryResult" + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + parameters: "_models.ForecastDefinition", + filter: Optional[str] = None, + **kwargs: Any + ) -> "_models.QueryResult": """Lists the forecast charges for external cloud provider type defined. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -153,7 +242,7 @@ def external_cloud_provider_usage( :type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition :param filter: May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', - and 'and'. It does not currently support 'ne', 'or', or 'not'. + and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QueryResult, or the result of cls(response) @@ -165,39 +254,34 @@ def external_cloud_provider_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.external_cloud_provider_usage.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ForecastDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ForecastDefinition') + + request = build_external_cloud_provider_usage_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + content_type=content_type, + json=_json, + filter=filter, + template_url=self.external_cloud_provider_usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('QueryResult', pipeline_response) @@ -206,4 +290,6 @@ def external_cloud_provider_usage( return cls(pipeline_response, deserialized, {}) return deserialized - external_cloud_provider_usage.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast'} # type: ignore + + external_cloud_provider_usage.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py new file mode 100644 index 000000000000..ec7666308e2a --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_results_operations.py @@ -0,0 +1,154 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + operation_id: str, + scope: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}") + path_format_arguments = { + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +class GenerateDetailedCostReportOperationResultsOperations(object): + """GenerateDetailedCostReportOperationResultsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + operation_id: str, + scope: str, + **kwargs: Any + ) -> Optional["_models.GenerateDetailedCostReportOperationResult"]: + """Get the result of the specified operation. This link is provided in the + GenerateDetailedCostReport creation request response header. + + :param operation_id: The target operation Id. + :type operation_id: str + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateDetailedCostReportOperationResult, or the result of cls(response) + :rtype: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GenerateDetailedCostReportOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + operation_id=operation_id, + scope=scope, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py new file mode 100644 index 000000000000..00697d9e20e6 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operation_status_operations.py @@ -0,0 +1,152 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + operation_id: str, + scope: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}") + path_format_arguments = { + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +class GenerateDetailedCostReportOperationStatusOperations(object): + """GenerateDetailedCostReportOperationStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + operation_id: str, + scope: str, + **kwargs: Any + ) -> "_models.GenerateDetailedCostReportOperationStatuses": + """Get the status of the specified operation. This link is provided in the + GenerateDetailedCostReport creation request response header. + + :param operation_id: The target operation Id. + :type operation_id: str + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GenerateDetailedCostReportOperationStatuses, or the result of cls(response) + :rtype: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationStatuses + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateDetailedCostReportOperationStatuses"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + + request = build_get_request( + operation_id=operation_id, + scope=scope, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GenerateDetailedCostReportOperationStatuses', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py new file mode 100644 index 000000000000..b9e736b0ee90 --- /dev/null +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_detailed_cost_report_operations.py @@ -0,0 +1,233 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_operation_request_initial( + scope: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + +class GenerateDetailedCostReportOperations(object): + """GenerateDetailedCostReportOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.costmanagement.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_operation_initial( + self, + scope: str, + parameters: "_models.GenerateDetailedCostReportDefinition", + **kwargs: Any + ) -> Optional["_models.GenerateDetailedCostReportOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GenerateDetailedCostReportOperationResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'GenerateDetailedCostReportDefinition') + + request = build_create_operation_request_initial( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_operation_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + + if response.status_code == 202: + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-Consumption-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-Consumption-AsyncOperation')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _create_operation_initial.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore + + + @distributed_trace + def begin_create_operation( + self, + scope: str, + parameters: "_models.GenerateDetailedCostReportDefinition", + **kwargs: Any + ) -> LROPoller["_models.GenerateDetailedCostReportOperationResult"]: + """Generates the detailed cost report for provided date range, billing period(Only enterprise + customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header + Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the + operation will provide the status and if the operation is completed the blob file where + generated detailed cost report is being stored. + + :param scope: The scope associated with usage details operations. This includes + '/subscriptions/{subscriptionId}/' for subscription scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount + scope. Also, Modern Commerce Account scopes are + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, + '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + for billingProfile scope, + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + for invoiceSection scope, and + 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + specific for partners. + :type scope: str + :param parameters: Parameters supplied to the Create detailed cost report operation. + :type parameters: ~azure.mgmt.costmanagement.models.GenerateDetailedCostReportDefinition + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either GenerateDetailedCostReportOperationResult + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.GenerateDetailedCostReportOperationResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateDetailedCostReportOperationResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_operation_initial( + scope=scope, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('GenerateDetailedCostReportOperationResult', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_operation.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py index 4c93c64e8755..e953cdd720f3 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_generate_reservation_details_report_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,24 +6,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_by_billing_account_id_request_initial( + billing_account_id: str, + *, + start_date: str, + end_date: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") # pylint: disable=line-too-long + path_format_arguments = { + "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['startDate'] = _SERIALIZER.query("start_date", start_date, 'str') + _query_parameters['endDate'] = _SERIALIZER.query("end_date", end_date, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_by_billing_profile_id_request_initial( + billing_account_id: str, + billing_profile_id: str, + *, + start_date: str, + end_date: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport") # pylint: disable=line-too-long + path_format_arguments = { + "billingAccountId": _SERIALIZER.url("billing_account_id", billing_account_id, 'str'), + "billingProfileId": _SERIALIZER.url("billing_profile_id", billing_profile_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['startDate'] = _SERIALIZER.query("start_date", start_date, 'str') + _query_parameters['endDate'] = _SERIALIZER.query("end_date", end_date, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class GenerateReservationDetailsReportOperations(object): """GenerateReservationDetailsReportOperations operations. @@ -48,69 +126,67 @@ def __init__(self, client, config, serializer, deserializer): def _by_billing_account_id_initial( self, - billing_account_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OperationStatus"] + billing_account_id: str, + start_date: str, + end_date: str, + **kwargs: Any + ) -> Optional["_models.OperationStatus"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - # Construct URL - url = self._by_billing_account_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_by_billing_account_id_request_initial( + billing_account_id=billing_account_id, + api_version=api_version, + start_date=start_date, + end_date=end_date, + template_url=self._by_billing_account_id_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationStatus', pipeline_response) if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _by_billing_account_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + _by_billing_account_id_initial.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + + + @distributed_trace def begin_by_billing_account_id( self, - billing_account_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OperationStatus"] + billing_account_id: str, + start_date: str, + end_date: str, + **kwargs: Any + ) -> LROPoller["_models.OperationStatus"]: """Generates the reservations details report for provided date range asynchronously based on enrollment id. @@ -122,14 +198,18 @@ def begin_by_billing_account_id( :type end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( @@ -142,25 +222,21 @@ def begin_by_billing_account_id( billing_account_id=billing_account_id, start_date=start_date, end_date=end_date, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -170,78 +246,76 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_account_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_by_billing_account_id.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore def _by_billing_profile_id_initial( self, - billing_account_id, # type: str - billing_profile_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.OperationStatus"] + billing_account_id: str, + billing_profile_id: str, + start_date: str, + end_date: str, + **kwargs: Any + ) -> Optional["_models.OperationStatus"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatus"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self._by_billing_profile_id_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['startDate'] = self._serialize.query("start_date", start_date, 'str') - query_parameters['endDate'] = self._serialize.query("end_date", end_date, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_by_billing_profile_id_request_initial( + billing_account_id=billing_account_id, + billing_profile_id=billing_profile_id, + api_version=api_version, + start_date=start_date, + end_date=end_date, + template_url=self._by_billing_profile_id_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationStatus', pipeline_response) if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized - _by_billing_profile_id_initial.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + _by_billing_profile_id_initial.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore + + + @distributed_trace def begin_by_billing_profile_id( self, - billing_account_id, # type: str - billing_profile_id, # type: str - start_date, # type: str - end_date, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.OperationStatus"] + billing_account_id: str, + billing_profile_id: str, + start_date: str, + end_date: str, + **kwargs: Any + ) -> LROPoller["_models.OperationStatus"]: """Generates the reservations details report for provided date range asynchronously by billing profile. @@ -255,14 +329,18 @@ def begin_by_billing_profile_id( :type end_date: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either OperationStatus or the result of cls(response) + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OperationStatus or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.costmanagement.models.OperationStatus] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] lro_delay = kwargs.pop( @@ -276,26 +354,21 @@ def begin_by_billing_profile_id( billing_profile_id=billing_profile_id, start_date=start_date, end_date=end_date, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('OperationStatus', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'billingAccountId': self._serialize.url("billing_account_id", billing_account_id, 'str'), - 'billingProfileId': self._serialize.url("billing_profile_id", billing_profile_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -305,6 +378,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_by_billing_profile_id.metadata = {'url': '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport'} # type: ignore + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_by_billing_profile_id.metadata = {'url': "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py index 4a538a66f2c5..ad36b986e8dd 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,23 +6,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/operations") + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,11 +73,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] + **kwargs: Any + ) -> Iterable["_models.OperationListResult"]: """Lists all of the available cost management REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,35 +85,36 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) + deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,17 +123,22 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.CostManagement/operations"} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py index b5dd2dc857ec..712f043b67ba 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_query_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,22 +6,106 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_usage_request( + scope: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/query") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str', skip_quote=True), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +def build_usage_by_external_cloud_provider_type_request( + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query") # pylint: disable=line-too-long + path_format_arguments = { + "externalCloudProviderType": _SERIALIZER.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), + "externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) class QueryOperations(object): """QueryOperations operations. @@ -44,13 +129,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def usage( self, - scope, # type: str - parameters, # type: "_models.QueryDefinition" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.QueryResult"] + scope: str, + parameters: "_models.QueryDefinition", + **kwargs: Any + ) -> Optional["_models.QueryResult"]: """Query the usage data for scope defined. :param scope: The scope associated with query and export operations. This includes @@ -82,36 +167,32 @@ def usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'QueryDefinition') + + request = build_usage_request( + scope=scope, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.usage.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = None @@ -122,22 +203,25 @@ def usage( return cls(pipeline_response, deserialized, {}) return deserialized - usage.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/query'} # type: ignore + usage.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/query"} # type: ignore + + + @distributed_trace def usage_by_external_cloud_provider_type( self, - external_cloud_provider_type, # type: Union[str, "_models.ExternalCloudProviderType"] - external_cloud_provider_id, # type: str - parameters, # type: "_models.QueryDefinition" - **kwargs # type: Any - ): - # type: (...) -> "_models.QueryResult" + external_cloud_provider_type: Union[str, "_models.ExternalCloudProviderType"], + external_cloud_provider_id: str, + parameters: "_models.QueryDefinition", + **kwargs: Any + ) -> "_models.QueryResult": """Query the usage data for external cloud provider type defined. :param external_cloud_provider_type: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - :type external_cloud_provider_type: str or ~azure.mgmt.costmanagement.models.ExternalCloudProviderType + :type external_cloud_provider_type: str or + ~azure.mgmt.costmanagement.models.ExternalCloudProviderType :param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. :type external_cloud_provider_id: str @@ -153,37 +237,33 @@ def usage_by_external_cloud_provider_type( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.usage_by_external_cloud_provider_type.metadata['url'] # type: ignore - path_format_arguments = { - 'externalCloudProviderType': self._serialize.url("external_cloud_provider_type", external_cloud_provider_type, 'str'), - 'externalCloudProviderId': self._serialize.url("external_cloud_provider_id", external_cloud_provider_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryDefinition') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'QueryDefinition') + + request = build_usage_by_external_cloud_provider_type_request( + external_cloud_provider_type=external_cloud_provider_type, + external_cloud_provider_id=external_cloud_provider_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.usage_by_external_cloud_provider_type.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('QueryResult', pipeline_response) @@ -192,4 +272,6 @@ def usage_by_external_cloud_provider_type( return cls(pipeline_response, deserialized, {}) return deserialized - usage_by_external_cloud_provider_type.metadata = {'url': '/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query'} # type: ignore + + usage_by_external_cloud_provider_type.metadata = {'url': "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query"} # type: ignore + diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py deleted file mode 100644 index 3140937a8c4c..000000000000 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_settings_operations.py +++ /dev/null @@ -1,281 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SettingsOperations(object): - """SettingsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.costmanagement.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SettingsListResult"] - """Lists all of the settings that have been customized. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SettingsListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.SettingsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SettingsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SettingsListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/settings'} # type: ignore - - def get( - self, - setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Setting" - """Retrieves the current value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - def create_or_update( - self, - setting_name, # type: str - parameters, # type: "_models.Setting" - **kwargs # type: Any - ): - # type: (...) -> "_models.Setting" - """Sets a new value for a specific setting. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :param parameters: Body supplied to the CreateOrUpdate setting operation. - :type parameters: ~azure.mgmt.costmanagement.models.Setting - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Setting, or the result of cls(response) - :rtype: ~azure.mgmt.costmanagement.models.Setting - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Setting"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Setting') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Setting', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore - - def delete( - self, - setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Remove the current value for a specific setting and reverts back to the default value, if - applicable. - - :param setting_name: Name of the setting. Allowed values: myscope. - :type setting_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'settingName': self._serialize.url("setting_name", setting_name, 'str', max_length=32, min_length=0), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/providers/Microsoft.CostManagement/settings/{settingName}'} # type: ignore diff --git a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py index d7512a2a7003..9aaa3cab63f2 100644 --- a/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py +++ b/sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_views_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,23 +6,297 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/views") + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_scope_request( + scope: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/views") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + view_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + view_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + view_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_by_scope_request( + scope: str, + view_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str'), + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_by_scope_request( + scope: str, + view_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str'), + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_by_scope_request( + scope: str, + view_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/views/{viewName}") + path_format_arguments = { + "scope": _SERIALIZER.url("scope", scope, 'str'), + "viewName": _SERIALIZER.url("view_name", view_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) class ViewsOperations(object): """ViewsOperations operations. @@ -45,47 +320,48 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ViewListResult"] + **kwargs: Any + ) -> Iterable["_models.ViewListResult"]: """Lists all views by tenant and object. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ViewListResult', pipeline_response) + deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,27 +370,32 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.CostManagement/views'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.CostManagement/views"} # type: ignore + @distributed_trace def list_by_scope( self, - scope, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ViewListResult"] + scope: str, + **kwargs: Any + ) -> Iterable["_models.ViewListResult"]: """Lists all views at the given scope. :param scope: The scope associated with view operations. This includes @@ -137,42 +418,41 @@ def list_by_scope( :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ViewListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResultor None] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.costmanagement.models.ViewListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ViewListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_scope_request( + scope=scope, + api_version=api_version, + template_url=self.list_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_scope_request( + scope=scope, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ViewListResult', pipeline_response) + deserialized = self._deserialize("ViewListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -181,27 +461,32 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) - list_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views'} # type: ignore + list_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views"} # type: ignore + @distributed_trace def get( self, - view_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.View" + view_name: str, + **kwargs: Any + ) -> "_models.View": """Gets the view by view name. :param view_name: View name. @@ -216,31 +501,28 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + view_name=view_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('View', pipeline_response) @@ -249,15 +531,17 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + get.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace def create_or_update( self, - view_name, # type: str - parameters, # type: "_models.View" - **kwargs # type: Any - ): - # type: (...) -> "_models.View" + view_name: str, + parameters: "_models.View", + **kwargs: Any + ) -> "_models.View": """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. @@ -276,36 +560,32 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'View') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'View') + + request = build_create_or_update_request( + view_name=view_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -318,14 +598,16 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore - def delete( + create_or_update.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements self, - view_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + view_name: str, + **kwargs: Any + ) -> None: """The operation to delete a view. :param view_name: View name. @@ -340,45 +622,43 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + view_name=view_name, + api_version=api_version, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + delete.metadata = {'url': "/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + @distributed_trace def get_by_scope( self, - scope, # type: str - view_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.View" + scope: str, + view_name: str, + **kwargs: Any + ) -> "_models.View": """Gets the view for the defined scope by view name. :param scope: The scope associated with view operations. This includes @@ -411,32 +691,29 @@ def get_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.get_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + template_url=self.get_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('View', pipeline_response) @@ -445,16 +722,18 @@ def get_by_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + get_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace def create_or_update_by_scope( self, - scope, # type: str - view_name, # type: str - parameters, # type: "_models.View" - **kwargs # type: Any - ): - # type: (...) -> "_models.View" + scope: str, + view_name: str, + parameters: "_models.View", + **kwargs: Any + ) -> "_models.View": """The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. @@ -491,37 +770,33 @@ def create_or_update_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'View') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + + api_version = kwargs.pop('api_version', "2021-10-01") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'View') + + request = build_create_or_update_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -534,15 +809,17 @@ def create_or_update_by_scope( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore - def delete_by_scope( + create_or_update_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore + + + @distributed_trace + def delete_by_scope( # pylint: disable=inconsistent-return-statements self, - scope, # type: str - view_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + scope: str, + view_name: str, + **kwargs: Any + ) -> None: """The operation to delete a view. :param scope: The scope associated with view operations. This includes @@ -575,35 +852,33 @@ def delete_by_scope( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-11-01" - accept = "application/json" - - # Construct URL - url = self.delete_by_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str'), - 'viewName': self._serialize.url("view_name", view_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + api_version = kwargs.pop('api_version', "2021-10-01") # type: str - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_by_scope_request( + scope=scope, + view_name=view_name, + api_version=api_version, + template_url=self.delete_by_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete_by_scope.metadata = {'url': '/{scope}/providers/Microsoft.CostManagement/views/{viewName}'} # type: ignore + delete_by_scope.metadata = {'url': "/{scope}/providers/Microsoft.CostManagement/views/{viewName}"} # type: ignore +